Mercurial > hg > orthanc
annotate Plugins/Include/orthanc/OrthancCPlugin.h @ 1810:796d0b087fb8 worklists
more consistent naming in worklist primitives
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 23 Nov 2015 17:09:27 +0100 |
parents | d093f998a83b |
children | 2abfdca9b915 |
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(). |
1466
0cd0f2ad3599
Fix potential deadlock in the callbacks of plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1430
diff
changeset
|
17 * - Possibly register its callback for received DICOM instances using ::OrthancPluginRegisterOnStoredInstanceCallback(). |
0cd0f2ad3599
Fix potential deadlock in the callbacks of plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1430
diff
changeset
|
18 * - Possibly register its callback for changes to the DICOM store using ::OrthancPluginRegisterOnChangeCallback(). |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
19 * - Possibly register a custom storage area using ::OrthancPluginRegisterStorageArea(). |
1609
c74495267acf
Implementation of the "GetAllPublicIdsWithLimit" extension
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1608
diff
changeset
|
20 * - Possibly register a custom database back-end area using OrthancPluginRegisterDatabaseBackendV2(). |
1803 | 21 * - Possibly register a handler for C-Find SCP against DICOM worklists using OrthancPluginRegisterWorklistCallback(). |
907 | 22 * -# <tt>void OrthancPluginFinalize()</tt>: |
23 * This function is invoked by Orthanc during its shutdown. The plugin | |
24 * must free all its memory. | |
25 * -# <tt>const char* OrthancPluginGetName()</tt>: | |
26 * 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
|
27 * -# <tt>const char* OrthancPluginGetVersion()</tt>: |
907 | 28 * The plugin must return a string containing its version number. |
29 * | |
30 * The name and the version of a plugin is only used to prevent it | |
1602 | 31 * from being loaded twice. Note that, in C++, it is mandatory to |
32 * declare these functions within an <tt>extern "C"</tt> section. | |
907 | 33 * |
1595
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
34 * To ensure multi-threading safety, the various REST callbacks are |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
35 * guaranteed to be executed in mutual exclusion since Orthanc |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
36 * 0.8.5. If this feature is undesired (notably when developing |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
37 * high-performance plugins handling simultaneous requests), use |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
38 * ::OrthancPluginRegisterRestCallbackNoLock(). |
906
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
39 **/ |
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
40 |
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
41 |
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
42 |
900 | 43 /** |
1613
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
44 * @defgroup Images Images and compression |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
45 * @brief Functions to deal with images and compressed buffers. |
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
46 * |
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
47 * @defgroup REST REST |
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
48 * @brief Functions to answer REST requests in a callback. |
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
49 * |
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
50 * @defgroup Callbacks Callbacks |
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
51 * @brief Functions to register and manage callbacks by the plugins. |
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
52 * |
1799
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
53 * @defgroup Worklists Worklists |
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
54 * @brief Functions to register and manage worklists. |
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
55 * |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
56 * @defgroup Orthanc Orthanc |
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
57 * @brief Functions to access the content of the Orthanc server. |
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
58 **/ |
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
59 |
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
60 |
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
61 |
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
62 /** |
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
63 * @defgroup Toolbox Toolbox |
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
64 * @brief Generic functions to help with the creation of plugins. |
900 | 65 **/ |
66 | |
67 | |
906
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
68 |
886 | 69 /** |
70 * Orthanc - A Lightweight, RESTful DICOM Store | |
1288
6e7e5ed91c2d
upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1282
diff
changeset
|
71 * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics |
6e7e5ed91c2d
upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1282
diff
changeset
|
72 * Department, University Hospital of Liege, Belgium |
886 | 73 * |
74 * This program is free software: you can redistribute it and/or | |
75 * modify it under the terms of the GNU General Public License as | |
76 * published by the Free Software Foundation, either version 3 of the | |
77 * License, or (at your option) any later version. | |
78 * | |
79 * In addition, as a special exception, the copyright holders of this | |
80 * program give permission to link the code of its release with the | |
81 * OpenSSL project's "OpenSSL" library (or with modified versions of it | |
82 * that use the same license as the "OpenSSL" library), and distribute | |
83 * the linked executables. You must obey the GNU General Public License | |
84 * in all respects for all of the code used other than "OpenSSL". If you | |
85 * modify file(s) with this exception, you may extend this exception to | |
86 * your version of the file(s), but you are not obligated to do so. If | |
87 * you do not wish to do so, delete this exception statement from your | |
88 * version. If you delete this exception statement from all source files | |
89 * in the program, then also delete it here. | |
90 * | |
91 * This program is distributed in the hope that it will be useful, but | |
92 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
93 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
94 * General Public License for more details. | |
95 * | |
96 * You should have received a copy of the GNU General Public License | |
97 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
98 **/ | |
99 | |
100 | |
906
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
101 |
886 | 102 #pragma once |
103 | |
104 | |
900 | 105 #include <stdio.h> |
106 #include <string.h> | |
107 | |
886 | 108 #ifdef WIN32 |
109 #define ORTHANC_PLUGINS_API __declspec(dllexport) | |
110 #else | |
111 #define ORTHANC_PLUGINS_API | |
112 #endif | |
113 | |
1039
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
114 #define ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER 0 |
1407
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
115 #define ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER 9 |
1629
bad4772b605c
OrthancPluginErrorCode in database plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1628
diff
changeset
|
116 #define ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER 5 |
1039
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
117 |
886 | 118 |
898
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 /******************************************************************** |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
121 ** Check that function inlining is properly supported. The use of |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
122 ** inlining is required, to avoid the duplication of object code |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
123 ** between two compilation modules that would use the Orthanc Plugin |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
124 ** API. |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
125 ********************************************************************/ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
126 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
127 /* 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
|
128 automatically and that your compiler is known to properly support |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
129 inlining, uncomment the following #define and adapt the definition |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
130 of "static inline". */ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
131 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
132 /* #define ORTHANC_PLUGIN_INLINE static inline */ |
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 #ifndef ORTHANC_PLUGIN_INLINE |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
135 # if __STDC_VERSION__ >= 199901L |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
136 /* 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
|
137 # define ORTHANC_PLUGIN_INLINE static inline |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
138 # elif defined(__cplusplus) |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
139 /* This is C++ */ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
140 # define ORTHANC_PLUGIN_INLINE static inline |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
141 # elif defined(__GNUC__) |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
142 /* This is GCC running in C89 mode */ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
143 # define ORTHANC_PLUGIN_INLINE static __inline |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
144 # elif defined(_MSC_VER) |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
145 /* This is Visual Studio running in C89 mode */ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
146 # define ORTHANC_PLUGIN_INLINE static __inline |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
147 # else |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
148 # 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
|
149 # endif |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
150 #endif |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
151 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
152 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
153 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
154 /******************************************************************** |
907 | 155 ** Inclusion of standard libraries. |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
156 ********************************************************************/ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
157 |
1322
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1313
diff
changeset
|
158 /** |
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1313
diff
changeset
|
159 * For Microsoft Visual Studio, a compatibility "stdint.h" can be |
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1313
diff
changeset
|
160 * downloaded at the following URL: |
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1313
diff
changeset
|
161 * https://orthanc.googlecode.com/hg/Resources/ThirdParty/VisualStudio/stdint.h |
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1313
diff
changeset
|
162 **/ |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
163 #include <stdint.h> |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
164 |
886 | 165 #include <stdlib.h> |
166 | |
167 | |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
168 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
169 /******************************************************************** |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
170 ** Definition of the Orthanc Plugin API. |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
171 ********************************************************************/ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
172 |
900 | 173 /** @{ */ |
174 | |
886 | 175 #ifdef __cplusplus |
176 extern "C" | |
177 { | |
178 #endif | |
179 | |
907 | 180 /** |
1578 | 181 * The various error codes that can be returned by the Orthanc core. |
182 **/ | |
183 typedef enum | |
184 { | |
1579
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
185 OrthancPluginErrorCode_InternalError = -1 /*!< Internal error */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
186 OrthancPluginErrorCode_Success = 0 /*!< Success */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
187 OrthancPluginErrorCode_Plugin = 1 /*!< Error encountered within the plugin engine */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
188 OrthancPluginErrorCode_NotImplemented = 2 /*!< Not implemented yet */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
189 OrthancPluginErrorCode_ParameterOutOfRange = 3 /*!< Parameter out of range */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
190 OrthancPluginErrorCode_NotEnoughMemory = 4 /*!< Not enough memory */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
191 OrthancPluginErrorCode_BadParameterType = 5 /*!< Bad type for a parameter */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
192 OrthancPluginErrorCode_BadSequenceOfCalls = 6 /*!< Bad sequence of calls */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
193 OrthancPluginErrorCode_InexistentItem = 7 /*!< Accessing an inexistent item */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
194 OrthancPluginErrorCode_BadRequest = 8 /*!< Bad request */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
195 OrthancPluginErrorCode_NetworkProtocol = 9 /*!< Error in the network protocol */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
196 OrthancPluginErrorCode_SystemCommand = 10 /*!< Error while calling a system command */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
197 OrthancPluginErrorCode_Database = 11 /*!< Error with the database engine */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
198 OrthancPluginErrorCode_UriSyntax = 12 /*!< Badly formatted URI */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
199 OrthancPluginErrorCode_InexistentFile = 13 /*!< Inexistent file */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
200 OrthancPluginErrorCode_CannotWriteFile = 14 /*!< Cannot write to file */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
201 OrthancPluginErrorCode_BadFileFormat = 15 /*!< Bad file format */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
202 OrthancPluginErrorCode_Timeout = 16 /*!< Timeout */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
203 OrthancPluginErrorCode_UnknownResource = 17 /*!< Unknown resource */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
204 OrthancPluginErrorCode_IncompatibleDatabaseVersion = 18 /*!< Incompatible version of the database */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
205 OrthancPluginErrorCode_FullStorage = 19 /*!< The file storage is full */, |
1582
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
206 OrthancPluginErrorCode_CorruptedFile = 20 /*!< Corrupted file (e.g. inconsistent MD5 hash) */, |
1579
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
207 OrthancPluginErrorCode_InexistentTag = 21 /*!< Inexistent tag */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
208 OrthancPluginErrorCode_ReadOnly = 22 /*!< Cannot modify a read-only data structure */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
209 OrthancPluginErrorCode_IncompatibleImageFormat = 23 /*!< Incompatible format of the images */, |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
210 OrthancPluginErrorCode_IncompatibleImageSize = 24 /*!< Incompatible size of the images */, |
1580
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
211 OrthancPluginErrorCode_SharedLibrary = 25 /*!< Error while using a shared library (plugin) */, |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
212 OrthancPluginErrorCode_UnknownPluginService = 26 /*!< Plugin invoking an unknown service */, |
1582
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
213 OrthancPluginErrorCode_UnknownDicomTag = 27 /*!< Unknown DICOM tag */, |
1596
f2e3d030ea59
BadJson error code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1595
diff
changeset
|
214 OrthancPluginErrorCode_BadJson = 28 /*!< Cannot parse a JSON document */, |
1606
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
215 OrthancPluginErrorCode_Unauthorized = 29 /*!< Bad credentials were provided to an HTTP request */, |
1610
2dff2bdffdb8
font support within Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1609
diff
changeset
|
216 OrthancPluginErrorCode_BadFont = 30 /*!< Badly formatted font file */, |
1643
87c77b9b3679
provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1642
diff
changeset
|
217 OrthancPluginErrorCode_DatabasePlugin = 31 /*!< The plugin implementing a custom database back-end does not fulfill the proper interface */, |
87c77b9b3679
provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1642
diff
changeset
|
218 OrthancPluginErrorCode_StorageAreaPlugin = 32 /*!< Error in the plugin implementing a custom storage area */, |
1746 | 219 OrthancPluginErrorCode_EmptyRequest = 33 /*!< The request is empty */, |
1781
5ad4e4d92ecb
AcceptMediaDispatcher bootstrap
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1780
diff
changeset
|
220 OrthancPluginErrorCode_NotAcceptable = 34 /*!< Cannot send a response which is acceptable according to the Accept HTTP header */, |
1582
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
221 OrthancPluginErrorCode_SQLiteNotOpened = 1000 /*!< SQLite: The database is not opened */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
222 OrthancPluginErrorCode_SQLiteAlreadyOpened = 1001 /*!< SQLite: Connection is already open */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
223 OrthancPluginErrorCode_SQLiteCannotOpen = 1002 /*!< SQLite: Unable to open the database */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
224 OrthancPluginErrorCode_SQLiteStatementAlreadyUsed = 1003 /*!< SQLite: This cached statement is already being referred to */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
225 OrthancPluginErrorCode_SQLiteExecute = 1004 /*!< SQLite: Cannot execute a command */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
226 OrthancPluginErrorCode_SQLiteRollbackWithoutTransaction = 1005 /*!< SQLite: Rolling back a nonexistent transaction (have you called Begin()?) */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
227 OrthancPluginErrorCode_SQLiteCommitWithoutTransaction = 1006 /*!< SQLite: Committing a nonexistent transaction */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
228 OrthancPluginErrorCode_SQLiteRegisterFunction = 1007 /*!< SQLite: Unable to register a function */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
229 OrthancPluginErrorCode_SQLiteFlush = 1008 /*!< SQLite: Unable to flush the database */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
230 OrthancPluginErrorCode_SQLiteCannotRun = 1009 /*!< SQLite: Cannot run a cached statement */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
231 OrthancPluginErrorCode_SQLiteCannotStep = 1010 /*!< SQLite: Cannot step over a cached statement */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
232 OrthancPluginErrorCode_SQLiteBindOutOfRange = 1011 /*!< SQLite: Bing a value while out of range (serious error) */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
233 OrthancPluginErrorCode_SQLitePrepareStatement = 1012 /*!< SQLite: Cannot prepare a cached statement */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
234 OrthancPluginErrorCode_SQLiteTransactionAlreadyStarted = 1013 /*!< SQLite: Beginning the same transaction twice */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
235 OrthancPluginErrorCode_SQLiteTransactionCommit = 1014 /*!< SQLite: Failure when committing the transaction */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
236 OrthancPluginErrorCode_SQLiteTransactionBegin = 1015 /*!< SQLite: Cannot start a transaction */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
237 OrthancPluginErrorCode_DirectoryOverFile = 2000 /*!< The directory to be created is already occupied by a regular file */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
238 OrthancPluginErrorCode_FileStorageCannotWrite = 2001 /*!< Unable to create a subdirectory or a file in the file storage */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
239 OrthancPluginErrorCode_DirectoryExpected = 2002 /*!< The specified path does not point to a directory */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
240 OrthancPluginErrorCode_HttpPortInUse = 2003 /*!< The TCP port of the HTTP server is already in use */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
241 OrthancPluginErrorCode_DicomPortInUse = 2004 /*!< The TCP port of the DICOM server is already in use */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
242 OrthancPluginErrorCode_BadHttpStatusInRest = 2005 /*!< This HTTP status is not allowed in a REST API */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
243 OrthancPluginErrorCode_RegularFileExpected = 2006 /*!< The specified path does not point to a regular file */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
244 OrthancPluginErrorCode_PathToExecutable = 2007 /*!< Unable to get the path to the executable */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
245 OrthancPluginErrorCode_MakeDirectory = 2008 /*!< Cannot create a directory */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
246 OrthancPluginErrorCode_BadApplicationEntityTitle = 2009 /*!< An application entity title (AET) cannot be empty or be longer than 16 characters */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
247 OrthancPluginErrorCode_NoCFindHandler = 2010 /*!< No request handler factory for DICOM C-FIND SCP */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
248 OrthancPluginErrorCode_NoCMoveHandler = 2011 /*!< No request handler factory for DICOM C-MOVE SCP */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
249 OrthancPluginErrorCode_NoCStoreHandler = 2012 /*!< No request handler factory for DICOM C-STORE SCP */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
250 OrthancPluginErrorCode_NoApplicationEntityFilter = 2013 /*!< No application entity filter */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
251 OrthancPluginErrorCode_NoSopClassOrInstance = 2014 /*!< DicomUserConnection: Unable to find the SOP class and instance */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
252 OrthancPluginErrorCode_NoPresentationContext = 2015 /*!< DicomUserConnection: No acceptable presentation context for modality */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
253 OrthancPluginErrorCode_DicomFindUnavailable = 2016 /*!< DicomUserConnection: The C-FIND command is not supported by the remote SCP */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
254 OrthancPluginErrorCode_DicomMoveUnavailable = 2017 /*!< DicomUserConnection: The C-MOVE command is not supported by the remote SCP */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
255 OrthancPluginErrorCode_CannotStoreInstance = 2018 /*!< Cannot store an instance */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
256 OrthancPluginErrorCode_CreateDicomNotString = 2019 /*!< Only string values are supported when creating DICOM instances */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
257 OrthancPluginErrorCode_CreateDicomOverrideTag = 2020 /*!< Trying to override a value inherited from a parent module */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
258 OrthancPluginErrorCode_CreateDicomUseContent = 2021 /*!< Use \"Content\" to inject an image into a new DICOM instance */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
259 OrthancPluginErrorCode_CreateDicomNoPayload = 2022 /*!< No payload is present for one instance in the series */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
260 OrthancPluginErrorCode_CreateDicomUseDataUriScheme = 2023 /*!< The payload of the DICOM instance must be specified according to Data URI scheme */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
261 OrthancPluginErrorCode_CreateDicomBadParent = 2024 /*!< Trying to attach a new DICOM instance to an inexistent resource */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
262 OrthancPluginErrorCode_CreateDicomParentIsInstance = 2025 /*!< Trying to attach a new DICOM instance to an instance (must be a series, study or patient) */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
263 OrthancPluginErrorCode_CreateDicomParentEncoding = 2026 /*!< Unable to get the encoding of the parent resource */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
264 OrthancPluginErrorCode_UnknownModality = 2027 /*!< Unknown modality */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
265 OrthancPluginErrorCode_BadJobOrdering = 2028 /*!< Bad ordering of filters in a job */, |
1583
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
266 OrthancPluginErrorCode_JsonToLuaTable = 2029 /*!< Cannot convert the given JSON object to a Lua table */, |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
267 OrthancPluginErrorCode_CannotCreateLua = 2030 /*!< Cannot create the Lua context */, |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
268 OrthancPluginErrorCode_CannotExecuteLua = 2031 /*!< Cannot execute a Lua command */, |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
269 OrthancPluginErrorCode_LuaAlreadyExecuted = 2032 /*!< Arguments cannot be pushed after the Lua function is executed */, |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
270 OrthancPluginErrorCode_LuaBadOutput = 2033 /*!< The Lua function does not give the expected number of outputs */, |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
271 OrthancPluginErrorCode_NotLuaPredicate = 2034 /*!< The Lua function is not a predicate (only true/false outputs allowed) */, |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
272 OrthancPluginErrorCode_LuaReturnsNoString = 2035 /*!< The Lua function does not return a string */, |
1630
ffd23c0104af
"/system" URI gives information about the plugins used for storage area and DB back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1629
diff
changeset
|
273 OrthancPluginErrorCode_StorageAreaAlreadyRegistered = 2036 /*!< Another plugin has already registered a custom storage area */, |
ffd23c0104af
"/system" URI gives information about the plugins used for storage area and DB back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1629
diff
changeset
|
274 OrthancPluginErrorCode_DatabaseBackendAlreadyRegistered = 2037 /*!< Another plugin has already registered a custom database back-end */, |
1643
87c77b9b3679
provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1642
diff
changeset
|
275 OrthancPluginErrorCode_DatabaseNotInitialized = 2038 /*!< Plugin trying to call the database during its initialization */, |
1674
4fc502d469f4
fix build if SSL is disabled
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1673
diff
changeset
|
276 OrthancPluginErrorCode_SslDisabled = 2039 /*!< Orthanc has been built without SSL support */, |
1703
b80e76dd1d56
ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1674
diff
changeset
|
277 OrthancPluginErrorCode_CannotOrderSlices = 2040 /*!< Unable to order the slices of the series */, |
1786
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1781
diff
changeset
|
278 OrthancPluginErrorCode_NoWorklistHandler = 2041 /*!< No request handler factory for DICOM C-Find Modality SCP */, |
1580
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
279 |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
280 _OrthancPluginErrorCode_INTERNAL = 0x7fffffff |
1578 | 281 } OrthancPluginErrorCode; |
282 | |
283 | |
284 /** | |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
285 * 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
|
286 * plugins. |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
287 **/ |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
288 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
|
289 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
290 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
291 /** |
907 | 292 * The various HTTP methods for a REST call. |
293 **/ | |
894 | 294 typedef enum |
295 { | |
907 | 296 OrthancPluginHttpMethod_Get = 1, /*!< GET request */ |
297 OrthancPluginHttpMethod_Post = 2, /*!< POST request */ | |
298 OrthancPluginHttpMethod_Put = 3, /*!< PUT request */ | |
1580
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
299 OrthancPluginHttpMethod_Delete = 4, /*!< DELETE request */ |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
300 |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
301 _OrthancPluginHttpMethod_INTERNAL = 0x7fffffff |
896 | 302 } OrthancPluginHttpMethod; |
886 | 303 |
907 | 304 |
305 /** | |
306 * @brief The parameters of a REST request. | |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
307 * @ingroup Callbacks |
907 | 308 **/ |
899 | 309 typedef struct |
310 { | |
907 | 311 /** |
312 * @brief The HTTP method. | |
313 **/ | |
314 OrthancPluginHttpMethod method; | |
899 | 315 |
907 | 316 /** |
317 * @brief The number of groups of the regular expression. | |
318 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
319 uint32_t groupsCount; |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
320 |
907 | 321 /** |
322 * @brief The matched values for the groups of the regular expression. | |
323 **/ | |
324 const char* const* groups; | |
325 | |
326 /** | |
327 * @brief For a GET request, the number of GET parameters. | |
328 **/ | |
899 | 329 uint32_t getCount; |
330 | |
907 | 331 /** |
332 * @brief For a GET request, the keys of the GET parameters. | |
333 **/ | |
334 const char* const* getKeys; | |
335 | |
336 /** | |
337 * @brief For a GET request, the values of the GET parameters. | |
338 **/ | |
339 const char* const* getValues; | |
340 | |
341 /** | |
342 * @brief For a PUT or POST request, the content of the body. | |
343 **/ | |
899 | 344 const char* body; |
907 | 345 |
346 /** | |
347 * @brief For a PUT or POST request, the number of bytes of the body. | |
348 **/ | |
899 | 349 uint32_t bodySize; |
1041
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
350 |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
351 |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
352 /* -------------------------------------------------- |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
353 New in version 0.8.1 |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
354 -------------------------------------------------- */ |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
355 |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
356 /** |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
357 * @brief The number of HTTP headers. |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
358 **/ |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
359 uint32_t headersCount; |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
360 |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
361 /** |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
362 * @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
|
363 **/ |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
364 const char* const* headersKeys; |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
365 |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
366 /** |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
367 * @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
|
368 **/ |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
369 const char* const* headersValues; |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
370 |
899 | 371 } OrthancPluginHttpRequest; |
372 | |
1041
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
373 |
900 | 374 typedef enum |
886 | 375 { |
900 | 376 /* Generic services */ |
907 | 377 _OrthancPluginService_LogInfo = 1, |
378 _OrthancPluginService_LogWarning = 2, | |
379 _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
|
380 _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
|
381 _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
|
382 _OrthancPluginService_GetConfigurationPath = 6, |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
383 _OrthancPluginService_SetPluginProperty = 7, |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
384 _OrthancPluginService_GetGlobalProperty = 8, |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
385 _OrthancPluginService_SetGlobalProperty = 9, |
1280
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
386 _OrthancPluginService_GetCommandLineArgumentsCount = 10, |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
387 _OrthancPluginService_GetCommandLineArgument = 11, |
1407
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
388 _OrthancPluginService_GetExpectedDatabaseVersion = 12, |
1424
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
389 _OrthancPluginService_GetConfiguration = 13, |
1554
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
390 _OrthancPluginService_BufferCompression = 14, |
1588
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
391 _OrthancPluginService_ReadFile = 15, |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
392 _OrthancPluginService_WriteFile = 16, |
1593
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
393 _OrthancPluginService_GetErrorDescription = 17, |
1606
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
394 _OrthancPluginService_CallHttpClient = 18, |
1649
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
395 _OrthancPluginService_RegisterErrorCode = 19, |
1657
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
396 _OrthancPluginService_RegisterDictionaryTag = 20, |
1740
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
397 _OrthancPluginService_DicomBufferToJson = 21, |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
398 _OrthancPluginService_DicomInstanceToJson = 22, |
900 | 399 |
400 /* Registration of callbacks */ | |
907 | 401 _OrthancPluginService_RegisterRestCallback = 1000, |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
402 _OrthancPluginService_RegisterOnStoredInstanceCallback = 1001, |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
403 _OrthancPluginService_RegisterStorageArea = 1002, |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
404 _OrthancPluginService_RegisterOnChangeCallback = 1003, |
1595
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
405 _OrthancPluginService_RegisterRestCallbackNoLock = 1004, |
1800
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
406 _OrthancPluginService_RegisterWorklistCallback = 1005, |
900 | 407 |
408 /* Sending answers to REST calls */ | |
907 | 409 _OrthancPluginService_AnswerBuffer = 2000, |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
410 _OrthancPluginService_CompressAndAnswerPngImage = 2001, /* Unused as of Orthanc 0.9.4 */ |
993
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
411 _OrthancPluginService_Redirect = 2002, |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
412 _OrthancPluginService_SendHttpStatusCode = 2003, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
413 _OrthancPluginService_SendUnauthorized = 2004, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
414 _OrthancPluginService_SendMethodNotAllowed = 2005, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
415 _OrthancPluginService_SetCookie = 2006, |
1137
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
416 _OrthancPluginService_SetHttpHeader = 2007, |
1430
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
417 _OrthancPluginService_StartMultipartAnswer = 2008, |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
418 _OrthancPluginService_SendMultipartItem = 2009, |
1593
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
419 _OrthancPluginService_SendHttpStatus = 2010, |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
420 _OrthancPluginService_CompressAndAnswerImage = 2011, |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
421 |
912
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
422 /* Access to the Orthanc database and API */ |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
423 _OrthancPluginService_GetDicomForInstance = 3000, |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
424 _OrthancPluginService_RestApiGet = 3001, |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
425 _OrthancPluginService_RestApiPost = 3002, |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
426 _OrthancPluginService_RestApiDelete = 3003, |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
427 _OrthancPluginService_RestApiPut = 3004, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
428 _OrthancPluginService_LookupPatient = 3005, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
429 _OrthancPluginService_LookupStudy = 3006, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
430 _OrthancPluginService_LookupSeries = 3007, |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
431 _OrthancPluginService_LookupInstance = 3008, |
1069
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
432 _OrthancPluginService_LookupStudyWithAccessionNumber = 3009, |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
433 _OrthancPluginService_RestApiGetAfterPlugins = 3010, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
434 _OrthancPluginService_RestApiPostAfterPlugins = 3011, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
435 _OrthancPluginService_RestApiDeleteAfterPlugins = 3012, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
436 _OrthancPluginService_RestApiPutAfterPlugins = 3013, |
1669
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
437 _OrthancPluginService_ReconstructMainDicomTags = 3014, |
1780
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
438 _OrthancPluginService_RestApiGet2 = 3015, |
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 /* Access to DICOM instances */ |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
441 _OrthancPluginService_GetInstanceRemoteAet = 4000, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
442 _OrthancPluginService_GetInstanceSize = 4001, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
443 _OrthancPluginService_GetInstanceData = 4002, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
444 _OrthancPluginService_GetInstanceJson = 4003, |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
445 _OrthancPluginService_GetInstanceSimplifiedJson = 4004, |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
446 _OrthancPluginService_HasInstanceMetadata = 4005, |
1309
8f4487d8f79e
new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1303
diff
changeset
|
447 _OrthancPluginService_GetInstanceMetadata = 4006, |
8f4487d8f79e
new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1303
diff
changeset
|
448 |
8f4487d8f79e
new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1303
diff
changeset
|
449 /* Services for plugins implementing a database back-end */ |
8f4487d8f79e
new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1303
diff
changeset
|
450 _OrthancPluginService_RegisterDatabaseBackend = 5000, |
1580
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
451 _OrthancPluginService_DatabaseAnswer = 5001, |
1609
c74495267acf
Implementation of the "GetAllPublicIdsWithLimit" extension
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1608
diff
changeset
|
452 _OrthancPluginService_RegisterDatabaseBackendV2 = 5002, |
1615
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
453 _OrthancPluginService_StorageAreaCreate = 5003, |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
454 _OrthancPluginService_StorageAreaRead = 5004, |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
455 _OrthancPluginService_StorageAreaRemove = 5005, |
1309
8f4487d8f79e
new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1303
diff
changeset
|
456 |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
457 /* Primitives for handling images */ |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
458 _OrthancPluginService_GetImagePixelFormat = 6000, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
459 _OrthancPluginService_GetImageWidth = 6001, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
460 _OrthancPluginService_GetImageHeight = 6002, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
461 _OrthancPluginService_GetImagePitch = 6003, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
462 _OrthancPluginService_GetImageBuffer = 6004, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
463 _OrthancPluginService_UncompressImage = 6005, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
464 _OrthancPluginService_FreeImage = 6006, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
465 _OrthancPluginService_CompressImage = 6007, |
1608
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
466 _OrthancPluginService_ConvertPixelFormat = 6008, |
1613
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
467 _OrthancPluginService_GetFontsCount = 6009, |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
468 _OrthancPluginService_GetFontInfo = 6010, |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
469 _OrthancPluginService_DrawText = 6011, |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
470 |
1800
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
471 /* Primitives for handling worklists */ |
1810
796d0b087fb8
more consistent naming in worklist primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1803
diff
changeset
|
472 _OrthancPluginService_WorklistAddAnswer = 7000, |
796d0b087fb8
more consistent naming in worklist primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1803
diff
changeset
|
473 _OrthancPluginService_WorklistMarkIncomplete = 7001, |
796d0b087fb8
more consistent naming in worklist primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1803
diff
changeset
|
474 _OrthancPluginService_WorklistIsMatch = 7002, |
796d0b087fb8
more consistent naming in worklist primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1803
diff
changeset
|
475 _OrthancPluginService_WorklistGetDicomQuery = 7003, |
1800
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
476 |
1580
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
477 _OrthancPluginService_INTERNAL = 0x7fffffff |
907 | 478 } _OrthancPluginService; |
900 | 479 |
480 | |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
481 typedef enum |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
482 { |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
483 _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
|
484 _OrthancPluginProperty_RootUri = 2, |
1580
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
485 _OrthancPluginProperty_OrthancExplorer = 3, |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
486 |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
487 _OrthancPluginProperty_INTERNAL = 0x7fffffff |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
488 } _OrthancPluginProperty; |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
489 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
490 |
900 | 491 |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
492 /** |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
493 * The memory layout of the pixels of an image. |
1613
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
494 * @ingroup Images |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
495 **/ |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
496 typedef enum |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
497 { |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
498 /** |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
499 * @brief Graylevel 8bpp image. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
500 * |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
501 * 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
|
502 * one byte. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
503 **/ |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
504 OrthancPluginPixelFormat_Grayscale8 = 1, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
505 |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
506 /** |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
507 * @brief Graylevel, unsigned 16bpp image. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
508 * |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
509 * 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
|
510 * two bytes. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
511 **/ |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
512 OrthancPluginPixelFormat_Grayscale16 = 2, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
513 |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
514 /** |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
515 * @brief Graylevel, signed 16bpp image. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
516 * |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
517 * 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
|
518 * bytes. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
519 **/ |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
520 OrthancPluginPixelFormat_SignedGrayscale16 = 3, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
521 |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
522 /** |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
523 * @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
|
524 * |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
525 * 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
|
526 * 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
|
527 **/ |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
528 OrthancPluginPixelFormat_RGB24 = 4, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
529 |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
530 /** |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
531 * @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
|
532 * |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
533 * 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
|
534 * 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
|
535 **/ |
1580
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
536 OrthancPluginPixelFormat_RGBA32 = 5, |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
537 |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
538 OrthancPluginPixelFormat_Unknown = 6, /*!< Unknown pixel format */ |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
539 |
1580
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
540 _OrthancPluginPixelFormat_INTERNAL = 0x7fffffff |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
541 } OrthancPluginPixelFormat; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
542 |
894 | 543 |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
544 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
545 /** |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
546 * 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
|
547 **/ |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
548 typedef enum |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
549 { |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
550 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
|
551 OrthancPluginContentType_Dicom = 1, /*!< DICOM */ |
1580
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
552 OrthancPluginContentType_DicomAsJson = 2, /*!< JSON summary of a DICOM file */ |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
553 |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
554 _OrthancPluginContentType_INTERNAL = 0x7fffffff |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
555 } OrthancPluginContentType; |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
556 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
557 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
558 |
907 | 559 /** |
1554
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
560 * The supported types of DICOM resources. |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
561 **/ |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
562 typedef enum |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
563 { |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
564 OrthancPluginResourceType_Patient = 0, /*!< Patient */ |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
565 OrthancPluginResourceType_Study = 1, /*!< Study */ |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
566 OrthancPluginResourceType_Series = 2, /*!< Series */ |
1580
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
567 OrthancPluginResourceType_Instance = 3, /*!< Instance */ |
1741
06addfcd1d4c
OrthancStarted and OrthancStopped events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1740
diff
changeset
|
568 OrthancPluginResourceType_None = 4, /*!< Unavailable resource type */ |
1580
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
569 |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
570 _OrthancPluginResourceType_INTERNAL = 0x7fffffff |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
571 } OrthancPluginResourceType; |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
572 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
573 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
574 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
575 /** |
1554
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
576 * The supported types of changes that can happen to DICOM resources. |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
577 * @ingroup Callbacks |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
578 **/ |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
579 typedef enum |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
580 { |
1198 | 581 OrthancPluginChangeType_CompletedSeries = 0, /*!< Series is now complete */ |
582 OrthancPluginChangeType_Deleted = 1, /*!< Deleted resource */ | |
583 OrthancPluginChangeType_NewChildInstance = 2, /*!< A new instance was added to this resource */ | |
584 OrthancPluginChangeType_NewInstance = 3, /*!< New instance received */ | |
585 OrthancPluginChangeType_NewPatient = 4, /*!< New patient created */ | |
586 OrthancPluginChangeType_NewSeries = 5, /*!< New series created */ | |
587 OrthancPluginChangeType_NewStudy = 6, /*!< New study created */ | |
588 OrthancPluginChangeType_StablePatient = 7, /*!< Timeout: No new instance in this patient */ | |
589 OrthancPluginChangeType_StableSeries = 8, /*!< Timeout: No new instance in this series */ | |
1580
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
590 OrthancPluginChangeType_StableStudy = 9, /*!< Timeout: No new instance in this study */ |
1741
06addfcd1d4c
OrthancStarted and OrthancStopped events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1740
diff
changeset
|
591 OrthancPluginChangeType_OrthancStarted = 10, /*!< Orthanc has started */ |
06addfcd1d4c
OrthancStarted and OrthancStopped events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1740
diff
changeset
|
592 OrthancPluginChangeType_OrthancStopped = 11, /*!< Orthanc is stopping */ |
1773
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1765
diff
changeset
|
593 OrthancPluginChangeType_UpdatedAttachment = 12, /*!< Some user-defined attachment has changed for this resource */ |
613df4362575
New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1765
diff
changeset
|
594 OrthancPluginChangeType_UpdatedMetadata = 13, /*!< Some user-defined metadata has changed for this resource */ |
1580
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
595 |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
596 _OrthancPluginChangeType_INTERNAL = 0x7fffffff |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
597 } OrthancPluginChangeType; |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
598 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
599 |
1554
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
600 /** |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
601 * The compression algorithms that are supported by the Orthanc core. |
1613
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
602 * @ingroup Images |
1554
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
603 **/ |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
604 typedef enum |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
605 { |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
606 OrthancPluginCompressionType_Zlib = 0, /*!< Standard zlib compression */ |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
607 OrthancPluginCompressionType_ZlibWithSize = 1, /*!< zlib, prefixed with uncompressed size (uint64_t) */ |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
608 OrthancPluginCompressionType_Gzip = 2, /*!< Standard gzip compression */ |
1580
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
609 OrthancPluginCompressionType_GzipWithSize = 3, /*!< gzip, prefixed with uncompressed size (uint64_t) */ |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
610 |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
611 _OrthancPluginCompressionType_INTERNAL = 0x7fffffff |
1554
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
612 } OrthancPluginCompressionType; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
613 |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
614 |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
615 /** |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
616 * The image formats that are supported by the Orthanc core. |
1613
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
617 * @ingroup Images |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
618 **/ |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
619 typedef enum |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
620 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
621 OrthancPluginImageFormat_Png = 0, /*!< Image compressed using PNG */ |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
622 OrthancPluginImageFormat_Jpeg = 1, /*!< Image compressed using JPEG */ |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
623 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
624 _OrthancPluginImageFormat_INTERNAL = 0x7fffffff |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
625 } OrthancPluginImageFormat; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
626 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
627 |
1657
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
628 /** |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
629 * The value representations present in the DICOM standard (version 2013). |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
630 * @ingroup Toolbox |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
631 **/ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
632 typedef enum |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
633 { |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
634 OrthancPluginValueRepresentation_AE = 1, /*!< Application Entity */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
635 OrthancPluginValueRepresentation_AS = 2, /*!< Age String */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
636 OrthancPluginValueRepresentation_AT = 3, /*!< Attribute Tag */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
637 OrthancPluginValueRepresentation_CS = 4, /*!< Code String */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
638 OrthancPluginValueRepresentation_DA = 5, /*!< Date */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
639 OrthancPluginValueRepresentation_DS = 6, /*!< Decimal String */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
640 OrthancPluginValueRepresentation_DT = 7, /*!< Date Time */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
641 OrthancPluginValueRepresentation_FD = 8, /*!< Floating Point Double */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
642 OrthancPluginValueRepresentation_FL = 9, /*!< Floating Point Single */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
643 OrthancPluginValueRepresentation_IS = 10, /*!< Integer String */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
644 OrthancPluginValueRepresentation_LO = 11, /*!< Long String */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
645 OrthancPluginValueRepresentation_LT = 12, /*!< Long Text */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
646 OrthancPluginValueRepresentation_OB = 13, /*!< Other Byte String */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
647 OrthancPluginValueRepresentation_OF = 14, /*!< Other Float String */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
648 OrthancPluginValueRepresentation_OW = 15, /*!< Other Word String */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
649 OrthancPluginValueRepresentation_PN = 16, /*!< Person Name */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
650 OrthancPluginValueRepresentation_SH = 17, /*!< Short String */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
651 OrthancPluginValueRepresentation_SL = 18, /*!< Signed Long */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
652 OrthancPluginValueRepresentation_SQ = 19, /*!< Sequence of Items */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
653 OrthancPluginValueRepresentation_SS = 20, /*!< Signed Short */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
654 OrthancPluginValueRepresentation_ST = 21, /*!< Short Text */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
655 OrthancPluginValueRepresentation_TM = 22, /*!< Time */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
656 OrthancPluginValueRepresentation_UI = 23, /*!< Unique Identifier (UID) */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
657 OrthancPluginValueRepresentation_UL = 24, /*!< Unsigned Long */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
658 OrthancPluginValueRepresentation_UN = 25, /*!< Unknown */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
659 OrthancPluginValueRepresentation_US = 26, /*!< Unsigned Short */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
660 OrthancPluginValueRepresentation_UT = 27, /*!< Unlimited Text */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
661 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
662 _OrthancPluginValueRepresentation_INTERNAL = 0x7fffffff |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
663 } OrthancPluginValueRepresentation; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
664 |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
665 |
1743 | 666 /** |
667 * The possible output formats for a DICOM-to-JSON conversion. | |
668 * @ingroup Toolbox | |
669 **/ | |
1740
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
670 typedef enum |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
671 { |
1743 | 672 OrthancPluginDicomToJsonFormat_Full = 1, /*!< Full output, with most details */ |
673 OrthancPluginDicomToJsonFormat_Short = 2, /*!< Tags output as hexadecimal numbers */ | |
674 OrthancPluginDicomToJsonFormat_Simple = 3, /*!< Human-readable JSON */ | |
1740
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
675 |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
676 _OrthancPluginDicomToJsonFormat_INTERNAL = 0x7fffffff |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
677 } OrthancPluginDicomToJsonFormat; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
678 |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
679 |
1743 | 680 /** |
681 * Flags to customize a DICOM-to-JSON conversion. By default, binary | |
682 * tags are formatted using Data URI scheme. | |
683 * @ingroup Toolbox | |
684 **/ | |
1740
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
685 typedef enum |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
686 { |
1743 | 687 OrthancPluginDicomToJsonFlags_IncludeBinary = (1 << 0), /*!< Include the binary tags */ |
688 OrthancPluginDicomToJsonFlags_IncludePrivateTags = (1 << 1), /*!< Include the private tags */ | |
689 OrthancPluginDicomToJsonFlags_IncludeUnknownTags = (1 << 2), /*!< Include the tags unknown by the dictionary */ | |
690 OrthancPluginDicomToJsonFlags_IncludePixelData = (1 << 3), /*!< Include the pixel data */ | |
691 OrthancPluginDicomToJsonFlags_ConvertBinaryToAscii = (1 << 4), /*!< Output binary tags as-is, dropping non-ASCII */ | |
692 OrthancPluginDicomToJsonFlags_ConvertBinaryToNull = (1 << 5), /*!< Signal binary tags as null values */ | |
1740
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
693 |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
694 _OrthancPluginDicomToJsonFlags_INTERNAL = 0x7fffffff |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
695 } OrthancPluginDicomToJsonFlags; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
696 |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
697 |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
698 /** |
1760
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1746
diff
changeset
|
699 * The constraints on the DICOM identifiers that must be supported |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1746
diff
changeset
|
700 * by the database plugins. |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1746
diff
changeset
|
701 **/ |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1746
diff
changeset
|
702 typedef enum |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1746
diff
changeset
|
703 { |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1746
diff
changeset
|
704 OrthancPluginIdentifierConstraint_Equal, /*!< Equal */ |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1746
diff
changeset
|
705 OrthancPluginIdentifierConstraint_SmallerOrEqual, /*!< Less or equal */ |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1746
diff
changeset
|
706 OrthancPluginIdentifierConstraint_GreaterOrEqual, /*!< More or equal */ |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1746
diff
changeset
|
707 OrthancPluginIdentifierConstraint_Wildcard, /*!< Case-sensitive wildcard matching (with * and ?) */ |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1746
diff
changeset
|
708 |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1746
diff
changeset
|
709 _OrthancPluginIdentifierConstraint_INTERNAL = 0x7fffffff |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1746
diff
changeset
|
710 } OrthancPluginIdentifierConstraint; |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1746
diff
changeset
|
711 |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1746
diff
changeset
|
712 |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1746
diff
changeset
|
713 |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1746
diff
changeset
|
714 /** |
907 | 715 * @brief A memory buffer allocated by the core system of Orthanc. |
716 * | |
717 * A memory buffer allocated by the core system of Orthanc. When the | |
718 * content of the buffer is not useful anymore, it must be free by a | |
719 * call to ::OrthancPluginFreeMemoryBuffer(). | |
720 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
721 typedef struct |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
722 { |
907 | 723 /** |
724 * @brief The content of the buffer. | |
725 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
726 void* data; |
907 | 727 |
728 /** | |
729 * @brief The number of bytes in the buffer. | |
730 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
731 uint32_t size; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
732 } OrthancPluginMemoryBuffer; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
733 |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
734 |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
735 |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
736 |
907 | 737 /** |
738 * @brief Opaque structure that represents the HTTP connection to the client application. | |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
739 * @ingroup Callback |
907 | 740 **/ |
900 | 741 typedef struct _OrthancPluginRestOutput_t OrthancPluginRestOutput; |
742 | |
907 | 743 |
1066
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 * @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
|
747 **/ |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
748 typedef struct _OrthancPluginDicomInstance_t OrthancPluginDicomInstance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
749 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
750 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
751 |
907 | 752 /** |
1615
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
753 * @brief Opaque structure that represents an image that is uncompressed in memory. |
1613
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
754 * @ingroup Images |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
755 **/ |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
756 typedef struct _OrthancPluginImage_t OrthancPluginImage; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
757 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
758 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
759 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
760 /** |
1615
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
761 * @brief Opaque structure that represents the storage area that is actually used by Orthanc. |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
762 * @ingroup Images |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
763 **/ |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
764 typedef struct _OrthancPluginStorageArea_t OrthancPluginStorageArea; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
765 |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
766 |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
767 |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
768 /** |
1799
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
769 * @brief Opaque structure to an object that represents a C-Find query. |
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
770 * @ingroup Worklists |
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
771 **/ |
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
772 typedef struct _OrthancPluginWorklistQuery_t OrthancPluginWorklistQuery; |
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
773 |
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
774 |
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
775 |
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
776 /** |
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
777 * @brief Opaque structure to an object that represents the answers to a C-Find query. |
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
778 * @ingroup Worklists |
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
779 **/ |
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
780 typedef struct _OrthancPluginWorklistAnswers_t OrthancPluginWorklistAnswers; |
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
781 |
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
782 |
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
783 |
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
784 /** |
908
e078ea944089
refactoring HttpOutput
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
907
diff
changeset
|
785 * @brief Signature of a callback function that answers to a REST request. |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
786 * @ingroup Callbacks |
907 | 787 **/ |
1628
77c4cc4def0f
OrthancPluginErrorCode in REST callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1627
diff
changeset
|
788 typedef OrthancPluginErrorCode (*OrthancPluginRestCallback) ( |
900 | 789 OrthancPluginRestOutput* output, |
790 const char* url, | |
791 const OrthancPluginHttpRequest* request); | |
792 | |
907 | 793 |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
794 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
795 /** |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
796 * @brief Signature of a callback function that is triggered when Orthanc receives a DICOM instance. |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
797 * @ingroup Callbacks |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
798 **/ |
1627
da7854deb662
Plugin callbacks must now return explicit "OrthancPluginErrorCode" instead of integers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1615
diff
changeset
|
799 typedef OrthancPluginErrorCode (*OrthancPluginOnStoredInstanceCallback) ( |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
800 OrthancPluginDicomInstance* instance, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
801 const char* instanceId); |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
802 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
803 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
804 |
907 | 805 /** |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
806 * @brief Signature of a callback function that is triggered when a change happens to some DICOM resource. |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
807 * @ingroup Callbacks |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
808 **/ |
1627
da7854deb662
Plugin callbacks must now return explicit "OrthancPluginErrorCode" instead of integers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1615
diff
changeset
|
809 typedef OrthancPluginErrorCode (*OrthancPluginOnChangeCallback) ( |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
810 OrthancPluginChangeType changeType, |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
811 OrthancPluginResourceType resourceType, |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
812 const char* resourceId); |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
813 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
814 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
815 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
816 /** |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
817 * @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
|
818 **/ |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
819 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
|
820 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
821 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
822 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
823 /** |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
824 * @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
|
825 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
826 * 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
|
827 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
828 * @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
|
829 * @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
|
830 * @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
|
831 * @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
|
832 * @return 0 if success, other value if error. |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
833 * @ingroup Callbacks |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
834 **/ |
1627
da7854deb662
Plugin callbacks must now return explicit "OrthancPluginErrorCode" instead of integers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1615
diff
changeset
|
835 typedef OrthancPluginErrorCode (*OrthancPluginStorageCreate) ( |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
836 const char* uuid, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
837 const void* content, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
838 int64_t size, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
839 OrthancPluginContentType type); |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
840 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
841 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
842 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
843 /** |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
844 * @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
|
845 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
846 * 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
|
847 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
848 * @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
|
849 * @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
|
850 * @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
|
851 * @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
|
852 * @return 0 if success, other value if error. |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
853 * @ingroup Callbacks |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
854 **/ |
1627
da7854deb662
Plugin callbacks must now return explicit "OrthancPluginErrorCode" instead of integers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1615
diff
changeset
|
855 typedef OrthancPluginErrorCode (*OrthancPluginStorageRead) ( |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
856 void** content, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
857 int64_t* size, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
858 const char* uuid, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
859 OrthancPluginContentType type); |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
860 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
861 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
862 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
863 /** |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
864 * @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
|
865 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
866 * 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
|
867 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
868 * @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
|
869 * @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
|
870 * @return 0 if success, other value if error. |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
871 * @ingroup Callbacks |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
872 **/ |
1627
da7854deb662
Plugin callbacks must now return explicit "OrthancPluginErrorCode" instead of integers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1615
diff
changeset
|
873 typedef OrthancPluginErrorCode (*OrthancPluginStorageRemove) ( |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
874 const char* uuid, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
875 OrthancPluginContentType type); |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
876 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
877 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
878 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
879 /** |
1799
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
880 * @brief Callback to handle the C-Find SCP requests received by Orthanc. |
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
881 * |
1803 | 882 * Signature of a callback function that is triggered when Orthanc |
883 * receives a C-Find SCP request against modality worklists. | |
1799
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
884 * |
1800
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
885 * @param answers The target structure where answers must be stored. |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
886 * @param query The worklist query. |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
887 * @param remoteAet The Application Entity Title (AET) of the modality from which the request originates. |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
888 * @param calledAet The Application Entity Title (AET) of the modality that is called by the request. |
1799
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
889 * @return 0 if success, other value if error. |
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
890 * @ingroup Worklists |
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
891 **/ |
1800
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
892 typedef OrthancPluginErrorCode (*OrthancPluginWorklistCallback) ( |
1799
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
893 OrthancPluginWorklistAnswers* answers, |
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
894 const OrthancPluginWorklistQuery* query, |
1800
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
895 const char* remoteAet, |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
896 const char* calledAet); |
1799
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
897 |
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
898 |
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
899 |
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
900 /** |
1297 | 901 * @brief Data structure that contains information about the Orthanc core. |
907 | 902 **/ |
900 | 903 typedef struct _OrthancPluginContext_t |
904 { | |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
905 void* pluginsManager; |
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
906 const char* orthancVersion; |
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
907 OrthancPluginFree Free; |
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
908 OrthancPluginErrorCode (*InvokeService) (struct _OrthancPluginContext_t* context, |
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
909 _OrthancPluginService service, |
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
910 const void* params); |
899 | 911 } OrthancPluginContext; |
912 | |
886 | 913 |
907 | 914 |
915 /** | |
916 * @brief Free a string. | |
917 * | |
918 * Free a string that was allocated by the core system of Orthanc. | |
919 * | |
920 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
921 * @param str The string to be freed. | |
922 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
923 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeString( |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
924 OrthancPluginContext* context, |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
925 char* str) |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
926 { |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
927 if (str != NULL) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
928 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
929 context->Free(str); |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
930 } |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
931 } |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
932 |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
933 |
907 | 934 /** |
1041
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
935 * @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
|
936 * |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
937 * 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
|
938 * 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
|
939 * this function should always be checked in the |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
940 * OrthancPluginInitialize() entry point of the plugin. |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
941 * |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
942 * @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
|
943 * @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
|
944 * result is 0, the initialization of the plugin should fail. |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
945 * @ingroup Callbacks |
1039
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
946 **/ |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
947 ORTHANC_PLUGIN_INLINE int OrthancPluginCheckVersion( |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
948 OrthancPluginContext* context) |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
949 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
950 int major, minor, revision; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
951 |
1579
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
952 if (sizeof(int32_t) != sizeof(OrthancPluginErrorCode) || |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
953 sizeof(int32_t) != sizeof(OrthancPluginHttpMethod) || |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
954 sizeof(int32_t) != sizeof(_OrthancPluginService) || |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
955 sizeof(int32_t) != sizeof(_OrthancPluginProperty) || |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
956 sizeof(int32_t) != sizeof(OrthancPluginPixelFormat) || |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
957 sizeof(int32_t) != sizeof(OrthancPluginContentType) || |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
958 sizeof(int32_t) != sizeof(OrthancPluginResourceType) || |
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
959 sizeof(int32_t) != sizeof(OrthancPluginChangeType) || |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
960 sizeof(int32_t) != sizeof(OrthancPluginCompressionType) || |
1657
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
961 sizeof(int32_t) != sizeof(OrthancPluginImageFormat) || |
1740
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
962 sizeof(int32_t) != sizeof(OrthancPluginValueRepresentation) || |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
963 sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFormat) || |
1760
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1746
diff
changeset
|
964 sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFlags) || |
51db4a25a741
LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1746
diff
changeset
|
965 sizeof(int32_t) != sizeof(OrthancPluginIdentifierConstraint)) |
1578 | 966 { |
967 /* Mismatch in the size of the enumerations */ | |
968 return 0; | |
969 } | |
970 | |
1039
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
971 /* Assume compatibility with the mainline */ |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
972 if (!strcmp(context->orthancVersion, "mainline")) |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
973 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
974 return 1; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
975 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
976 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
977 /* Parse the version of the Orthanc core */ |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
978 if ( |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
979 #ifdef _MSC_VER |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
980 sscanf_s |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
981 #else |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
982 sscanf |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
983 #endif |
1303 | 984 (context->orthancVersion, "%4d.%4d.%4d", &major, &minor, &revision) != 3) |
1039
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
985 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
986 return 0; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
987 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
988 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
989 /* Check the major number of the version */ |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
990 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
991 if (major > ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER) |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
992 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
993 return 1; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
994 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
995 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
996 if (major < ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER) |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
997 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
998 return 0; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
999 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
1000 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
1001 /* Check the minor number of the version */ |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
1002 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
1003 if (minor > ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER) |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
1004 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
1005 return 1; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
1006 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
1007 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
1008 if (minor < ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER) |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
1009 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
1010 return 0; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
1011 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
1012 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
1013 /* Check the revision number of the version */ |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
1014 |
1040
d06186cdc502
check plugin version in samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1039
diff
changeset
|
1015 if (revision >= ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER) |
1039
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
1016 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
1017 return 1; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
1018 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
1019 else |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
1020 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
1021 return 0; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
1022 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
1023 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
1024 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
1025 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
1026 /** |
907 | 1027 * @brief Free a memory buffer. |
1028 * | |
1029 * Free a memory buffer that was allocated by the core system of Orthanc. | |
1030 * | |
1031 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
1032 * @param buffer The memory buffer to release. | |
1033 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1034 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeMemoryBuffer( |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1035 OrthancPluginContext* context, |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1036 OrthancPluginMemoryBuffer* buffer) |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1037 { |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1038 context->Free(buffer->data); |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1039 } |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1040 |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1041 |
907 | 1042 /** |
1043 * @brief Log an error. | |
1044 * | |
1045 * Log an error message using the Orthanc logging system. | |
1046 * | |
1047 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
1048 * @param message The message to be logged. | |
1049 **/ | |
900 | 1050 ORTHANC_PLUGIN_INLINE void OrthancPluginLogError( |
1051 OrthancPluginContext* context, | |
907 | 1052 const char* message) |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
1053 { |
907 | 1054 context->InvokeService(context, _OrthancPluginService_LogError, message); |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
1055 } |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
1056 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
1057 |
907 | 1058 /** |
1059 * @brief Log a warning. | |
1060 * | |
1061 * Log a warning message using the Orthanc logging system. | |
1062 * | |
1063 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
1064 * @param message The message to be logged. | |
1065 **/ | |
900 | 1066 ORTHANC_PLUGIN_INLINE void OrthancPluginLogWarning( |
1067 OrthancPluginContext* context, | |
907 | 1068 const char* message) |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
1069 { |
907 | 1070 context->InvokeService(context, _OrthancPluginService_LogWarning, message); |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
1071 } |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
1072 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
1073 |
907 | 1074 /** |
1075 * @brief Log an information. | |
1076 * | |
1077 * Log an information message using the Orthanc logging system. | |
1078 * | |
1079 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
1080 * @param message The message to be logged. | |
1081 **/ | |
900 | 1082 ORTHANC_PLUGIN_INLINE void OrthancPluginLogInfo( |
1083 OrthancPluginContext* context, | |
907 | 1084 const char* message) |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
1085 { |
907 | 1086 context->InvokeService(context, _OrthancPluginService_LogInfo, message); |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
1087 } |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
1088 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
1089 |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1090 |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1091 typedef struct |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1092 { |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1093 const char* pathRegularExpression; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1094 OrthancPluginRestCallback callback; |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1095 } _OrthancPluginRestCallback; |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1096 |
907 | 1097 /** |
1098 * @brief Register a REST callback. | |
1099 * | |
1100 * This function registers a REST callback against a regular | |
1101 * expression for a URI. This function must be called during the | |
1102 * initialization of the plugin, i.e. inside the | |
1103 * OrthancPluginInitialize() public function. | |
1595
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1104 * |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1105 * Each REST callback is guaranteed to run in mutual exclusion. |
907 | 1106 * |
1107 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
1108 * @param pathRegularExpression Regular expression for the URI. May contain groups. | |
1109 * @param callback The callback function to handle the REST call. | |
1595
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1110 * @see OrthancPluginRegisterRestCallbackNoLock() |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1111 * @ingroup Callbacks |
907 | 1112 **/ |
900 | 1113 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallback( |
1114 OrthancPluginContext* context, | |
1115 const char* pathRegularExpression, | |
1116 OrthancPluginRestCallback callback) | |
899 | 1117 { |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1118 _OrthancPluginRestCallback params; |
899 | 1119 params.pathRegularExpression = pathRegularExpression; |
1120 params.callback = callback; | |
907 | 1121 context->InvokeService(context, _OrthancPluginService_RegisterRestCallback, ¶ms); |
899 | 1122 } |
1123 | |
1124 | |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1125 |
1595
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1126 /** |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1127 * @brief Register a REST callback, without locking. |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1128 * |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1129 * This function registers a REST callback against a regular |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1130 * expression for a URI. This function must be called during the |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1131 * initialization of the plugin, i.e. inside the |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1132 * OrthancPluginInitialize() public function. |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1133 * |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1134 * Contrarily to OrthancPluginRegisterRestCallback(), the callback |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1135 * will NOT be invoked in mutual exclusion. This can be useful for |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1136 * high-performance plugins that must handle concurrent requests |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1137 * (Orthanc uses a pool of threads, one thread being assigned to |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1138 * each incoming HTTP request). Of course, it is up to the plugin to |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1139 * implement the required locking mechanisms. |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1140 * |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1141 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1142 * @param pathRegularExpression Regular expression for the URI. May contain groups. |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1143 * @param callback The callback function to handle the REST call. |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1144 * @see OrthancPluginRegisterRestCallback() |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1145 * @ingroup Callbacks |
1595
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1146 **/ |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1147 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallbackNoLock( |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1148 OrthancPluginContext* context, |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1149 const char* pathRegularExpression, |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1150 OrthancPluginRestCallback callback) |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1151 { |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1152 _OrthancPluginRestCallback params; |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1153 params.pathRegularExpression = pathRegularExpression; |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1154 params.callback = callback; |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1155 context->InvokeService(context, _OrthancPluginService_RegisterRestCallbackNoLock, ¶ms); |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1156 } |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1157 |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1158 |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1159 |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1160 typedef struct |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1161 { |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1162 OrthancPluginOnStoredInstanceCallback callback; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1163 } _OrthancPluginOnStoredInstanceCallback; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1164 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1165 /** |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1166 * @brief Register a callback for received instances. |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1167 * |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1168 * This function registers a callback function that is called |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1169 * 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
|
1170 * |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1171 * @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
|
1172 * @param callback The callback function. |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1173 * @ingroup Callbacks |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1174 **/ |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1175 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnStoredInstanceCallback( |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1176 OrthancPluginContext* context, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1177 OrthancPluginOnStoredInstanceCallback callback) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1178 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1179 _OrthancPluginOnStoredInstanceCallback params; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1180 params.callback = callback; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1181 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1182 context->InvokeService(context, _OrthancPluginService_RegisterOnStoredInstanceCallback, ¶ms); |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1183 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1184 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1185 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1186 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1187 typedef struct |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1188 { |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1189 OrthancPluginRestOutput* output; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1190 const char* answer; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1191 uint32_t answerSize; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1192 const char* mimeType; |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1193 } _OrthancPluginAnswerBuffer; |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1194 |
907 | 1195 /** |
1196 * @brief Answer to a REST request. | |
1197 * | |
1198 * This function answers to a REST request with the content of a memory buffer. | |
1199 * | |
1200 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
1201 * @param output The HTTP connection to the client application. | |
1202 * @param answer Pointer to the memory buffer containing the answer. | |
1203 * @param answerSize Number of bytes of the answer. | |
1204 * @param mimeType The MIME type of the answer. | |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1205 * @ingroup REST |
907 | 1206 **/ |
900 | 1207 ORTHANC_PLUGIN_INLINE void OrthancPluginAnswerBuffer( |
1208 OrthancPluginContext* context, | |
1209 OrthancPluginRestOutput* output, | |
1210 const char* answer, | |
1211 uint32_t answerSize, | |
1212 const char* mimeType) | |
899 | 1213 { |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1214 _OrthancPluginAnswerBuffer params; |
899 | 1215 params.output = output; |
1216 params.answer = answer; | |
1217 params.answerSize = answerSize; | |
1218 params.mimeType = mimeType; | |
907 | 1219 context->InvokeService(context, _OrthancPluginService_AnswerBuffer, ¶ms); |
899 | 1220 } |
1221 | |
1222 | |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1223 typedef struct |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1224 { |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1225 OrthancPluginRestOutput* output; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1226 OrthancPluginPixelFormat format; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1227 uint32_t width; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1228 uint32_t height; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1229 uint32_t pitch; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1230 const void* buffer; |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1231 } _OrthancPluginCompressAndAnswerPngImage; |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1232 |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1233 typedef struct |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1234 { |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1235 OrthancPluginRestOutput* output; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1236 OrthancPluginImageFormat imageFormat; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1237 OrthancPluginPixelFormat pixelFormat; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1238 uint32_t width; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1239 uint32_t height; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1240 uint32_t pitch; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1241 const void* buffer; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1242 uint8_t quality; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1243 } _OrthancPluginCompressAndAnswerImage; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1244 |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1245 |
907 | 1246 /** |
1247 * @brief Answer to a REST request with a PNG image. | |
1248 * | |
1249 * This function answers to a REST request with a PNG image. The | |
1250 * parameters of this function describe a memory buffer that | |
1251 * contains an uncompressed image. The image will be automatically compressed | |
1252 * as a PNG image by the core system of Orthanc. | |
1253 * | |
1254 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
1255 * @param output The HTTP connection to the client application. | |
1256 * @param format The memory layout of the uncompressed image. | |
1257 * @param width The width of the image. | |
1258 * @param height The height of the image. | |
1259 * @param pitch The pitch of the image (i.e. the number of bytes | |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1260 * between 2 successive lines of the image in the memory buffer). |
907 | 1261 * @param buffer The memory buffer containing the uncompressed image. |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1262 * @ingroup REST |
907 | 1263 **/ |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1264 ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerPngImage( |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1265 OrthancPluginContext* context, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1266 OrthancPluginRestOutput* output, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1267 OrthancPluginPixelFormat format, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1268 uint32_t width, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1269 uint32_t height, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1270 uint32_t pitch, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1271 const void* buffer) |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1272 { |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1273 _OrthancPluginCompressAndAnswerImage params; |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1274 params.output = output; |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1275 params.imageFormat = OrthancPluginImageFormat_Png; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1276 params.pixelFormat = format; |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1277 params.width = width; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1278 params.height = height; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1279 params.pitch = pitch; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1280 params.buffer = buffer; |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1281 params.quality = 0; /* No quality for PNG */ |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1282 context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, ¶ms); |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1283 } |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1284 |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1285 |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1286 |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1287 typedef struct |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1288 { |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1289 OrthancPluginMemoryBuffer* target; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1290 const char* instanceId; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1291 } _OrthancPluginGetDicomForInstance; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1292 |
907 | 1293 /** |
1294 * @brief Retrieve a DICOM instance using its Orthanc identifier. | |
1295 * | |
1296 * Retrieve a DICOM instance using its Orthanc identifier. The DICOM | |
1297 * file is stored into a newly allocated memory buffer. | |
1298 * | |
1299 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
1300 * @param target The target memory buffer. | |
1301 * @param instanceId The Orthanc identifier of the DICOM instance of interest. | |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1302 * @return 0 if success, or the error code if failure. |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1303 * @ingroup Orthanc |
907 | 1304 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1305 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginGetDicomForInstance( |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1306 OrthancPluginContext* context, |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1307 OrthancPluginMemoryBuffer* target, |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1308 const char* instanceId) |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1309 { |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1310 _OrthancPluginGetDicomForInstance params; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1311 params.target = target; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1312 params.instanceId = instanceId; |
907 | 1313 return context->InvokeService(context, _OrthancPluginService_GetDicomForInstance, ¶ms); |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1314 } |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1315 |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
1316 |
912
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1317 |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1318 typedef struct |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1319 { |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1320 OrthancPluginMemoryBuffer* target; |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1321 const char* uri; |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1322 } _OrthancPluginRestApiGet; |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1323 |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1324 /** |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1325 * @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
|
1326 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1327 * 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
|
1328 * 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
|
1329 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1330 * @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
|
1331 * @param target The target memory buffer. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1332 * @param uri The URI in the built-in Orthanc API. |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1333 * @return 0 if success, or the error code if failure. |
1606
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
1334 * @see OrthancPluginRestApiGetAfterPlugins |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1335 * @ingroup Orthanc |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1336 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1337 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGet( |
912
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1338 OrthancPluginContext* context, |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1339 OrthancPluginMemoryBuffer* target, |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1340 const char* uri) |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1341 { |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1342 _OrthancPluginRestApiGet params; |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1343 params.target = target; |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1344 params.uri = uri; |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1345 return context->InvokeService(context, _OrthancPluginService_RestApiGet, ¶ms); |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1346 } |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1347 |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1348 |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1349 |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1350 /** |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1351 * @brief Make a GET call to the REST API, as tainted by the plugins. |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1352 * |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1353 * Make a GET call to the Orthanc REST API, after all the plugins |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1354 * are applied. In other words, if some plugin overrides or adds the |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1355 * called URI to the built-in Orthanc REST API, this call will |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1356 * return the result provided by this plugin. The result to the |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1357 * query is stored into a newly allocated memory buffer. |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1358 * |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1359 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1360 * @param target The target memory buffer. |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1361 * @param uri The URI in the built-in Orthanc API. |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1362 * @return 0 if success, or the error code if failure. |
1606
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
1363 * @see OrthancPluginRestApiGet |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1364 * @ingroup Orthanc |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1365 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1366 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGetAfterPlugins( |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1367 OrthancPluginContext* context, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1368 OrthancPluginMemoryBuffer* target, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1369 const char* uri) |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1370 { |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1371 _OrthancPluginRestApiGet params; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1372 params.target = target; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1373 params.uri = uri; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1374 return context->InvokeService(context, _OrthancPluginService_RestApiGetAfterPlugins, ¶ms); |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1375 } |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1376 |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1377 |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1378 |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1379 typedef struct |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1380 { |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1381 OrthancPluginMemoryBuffer* target; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1382 const char* uri; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1383 const char* body; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1384 uint32_t bodySize; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1385 } _OrthancPluginRestApiPostPut; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1386 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1387 /** |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1388 * @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
|
1389 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1390 * 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
|
1391 * 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
|
1392 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1393 * @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
|
1394 * @param target The target memory buffer. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1395 * @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
|
1396 * @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
|
1397 * @param bodySize The size of the body. |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1398 * @return 0 if success, or the error code if failure. |
1606
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
1399 * @see OrthancPluginRestApiPostAfterPlugins |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1400 * @ingroup Orthanc |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1401 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1402 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPost( |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1403 OrthancPluginContext* context, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1404 OrthancPluginMemoryBuffer* target, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1405 const char* uri, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1406 const char* body, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1407 uint32_t bodySize) |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1408 { |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1409 _OrthancPluginRestApiPostPut params; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1410 params.target = target; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1411 params.uri = uri; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1412 params.body = body; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1413 params.bodySize = bodySize; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1414 return context->InvokeService(context, _OrthancPluginService_RestApiPost, ¶ms); |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1415 } |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1416 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1417 |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1418 /** |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1419 * @brief Make a POST call to the REST API, as tainted by the plugins. |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1420 * |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1421 * Make a POST call to the Orthanc REST API, after all the plugins |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1422 * are applied. In other words, if some plugin overrides or adds the |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1423 * called URI to the built-in Orthanc REST API, this call will |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1424 * return the result provided by this plugin. The result to the |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1425 * query is stored into a newly allocated memory buffer. |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1426 * |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1427 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1428 * @param target The target memory buffer. |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1429 * @param uri The URI in the built-in Orthanc API. |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1430 * @param body The body of the POST request. |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1431 * @param bodySize The size of the body. |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1432 * @return 0 if success, or the error code if failure. |
1606
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
1433 * @see OrthancPluginRestApiPost |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1434 * @ingroup Orthanc |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1435 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1436 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPostAfterPlugins( |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1437 OrthancPluginContext* context, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1438 OrthancPluginMemoryBuffer* target, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1439 const char* uri, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1440 const char* body, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1441 uint32_t bodySize) |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1442 { |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1443 _OrthancPluginRestApiPostPut params; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1444 params.target = target; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1445 params.uri = uri; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1446 params.body = body; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1447 params.bodySize = bodySize; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1448 return context->InvokeService(context, _OrthancPluginService_RestApiPostAfterPlugins, ¶ms); |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1449 } |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1450 |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1451 |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1452 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1453 /** |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1454 * @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
|
1455 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1456 * 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
|
1457 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1458 * @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
|
1459 * @param uri The URI to delete in the built-in Orthanc API. |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1460 * @return 0 if success, or the error code if failure. |
1606
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
1461 * @see OrthancPluginRestApiDeleteAfterPlugins |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1462 * @ingroup Orthanc |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1463 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1464 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiDelete( |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1465 OrthancPluginContext* context, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1466 const char* uri) |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1467 { |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1468 return context->InvokeService(context, _OrthancPluginService_RestApiDelete, uri); |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1469 } |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1470 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1471 |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1472 /** |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1473 * @brief Make a DELETE call to the REST API, as tainted by the plugins. |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1474 * |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1475 * Make a DELETE call to the Orthanc REST API, after all the plugins |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1476 * are applied. In other words, if some plugin overrides or adds the |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1477 * called URI to the built-in Orthanc REST API, this call will |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1478 * return the result provided by this plugin. |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1479 * |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1480 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1481 * @param uri The URI to delete in the built-in Orthanc API. |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1482 * @return 0 if success, or the error code if failure. |
1606
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
1483 * @see OrthancPluginRestApiDelete |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1484 * @ingroup Orthanc |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1485 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1486 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiDeleteAfterPlugins( |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1487 OrthancPluginContext* context, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1488 const char* uri) |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1489 { |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1490 return context->InvokeService(context, _OrthancPluginService_RestApiDeleteAfterPlugins, uri); |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1491 } |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1492 |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1493 |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1494 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1495 /** |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1496 * @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
|
1497 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1498 * 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
|
1499 * 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
|
1500 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1501 * @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
|
1502 * @param target The target memory buffer. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1503 * @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
|
1504 * @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
|
1505 * @param bodySize The size of the body. |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1506 * @return 0 if success, or the error code if failure. |
1606
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
1507 * @see OrthancPluginRestApiPutAfterPlugins |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1508 * @ingroup Orthanc |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1509 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1510 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPut( |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1511 OrthancPluginContext* context, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1512 OrthancPluginMemoryBuffer* target, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1513 const char* uri, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1514 const char* body, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1515 uint32_t bodySize) |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1516 { |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1517 _OrthancPluginRestApiPostPut params; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1518 params.target = target; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1519 params.uri = uri; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1520 params.body = body; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1521 params.bodySize = bodySize; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1522 return context->InvokeService(context, _OrthancPluginService_RestApiPut, ¶ms); |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1523 } |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1524 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1525 |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1526 |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1527 /** |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1528 * @brief Make a PUT call to the REST API, as tainted by the plugins. |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1529 * |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1530 * Make a PUT call to the Orthanc REST API, after all the plugins |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1531 * are applied. In other words, if some plugin overrides or adds the |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1532 * called URI to the built-in Orthanc REST API, this call will |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1533 * return the result provided by this plugin. The result to the |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1534 * query is stored into a newly allocated memory buffer. |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1535 * |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1536 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1537 * @param target The target memory buffer. |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1538 * @param uri The URI in the built-in Orthanc API. |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1539 * @param body The body of the PUT request. |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1540 * @param bodySize The size of the body. |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1541 * @return 0 if success, or the error code if failure. |
1606
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
1542 * @see OrthancPluginRestApiPut |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1543 * @ingroup Orthanc |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1544 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1545 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPutAfterPlugins( |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1546 OrthancPluginContext* context, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1547 OrthancPluginMemoryBuffer* target, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1548 const char* uri, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1549 const char* body, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1550 uint32_t bodySize) |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1551 { |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1552 _OrthancPluginRestApiPostPut params; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1553 params.target = target; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1554 params.uri = uri; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1555 params.body = body; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1556 params.bodySize = bodySize; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1557 return context->InvokeService(context, _OrthancPluginService_RestApiPutAfterPlugins, ¶ms); |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1558 } |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1559 |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1560 |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1561 |
993
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1562 typedef struct |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1563 { |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1564 OrthancPluginRestOutput* output; |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1565 const char* argument; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1566 } _OrthancPluginOutputPlusArgument; |
993
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1567 |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1568 /** |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1569 * @brief Redirect a REST request. |
993
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1570 * |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1571 * 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
|
1572 * to another URI using HTTP status 301. |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1573 * |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1574 * @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
|
1575 * @param output The HTTP connection to the client application. |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1576 * @param redirection Where to redirect. |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1577 * @ingroup REST |
993
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1578 **/ |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1579 ORTHANC_PLUGIN_INLINE void OrthancPluginRedirect( |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1580 OrthancPluginContext* context, |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1581 OrthancPluginRestOutput* output, |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1582 const char* redirection) |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1583 { |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1584 _OrthancPluginOutputPlusArgument params; |
993
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1585 params.output = output; |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1586 params.argument = redirection; |
993
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1587 context->InvokeService(context, _OrthancPluginService_Redirect, ¶ms); |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1588 } |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1589 |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1590 |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1591 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1592 typedef struct |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1593 { |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1594 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
|
1595 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
|
1596 } _OrthancPluginRetrieveDynamicString; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1597 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1598 /** |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1599 * @brief Look for a patient. |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1600 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1601 * 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
|
1602 * 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
|
1603 * over all the stored patients). |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1604 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1605 * @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
|
1606 * @param patientID The Patient ID of interest. |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1607 * @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
|
1608 * Orthanc ID of the patient. This string must be freed by OrthancPluginFreeString(). |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1609 * @ingroup Orthanc |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1610 **/ |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1611 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupPatient( |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1612 OrthancPluginContext* context, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1613 const char* patientID) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1614 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1615 char* result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1616 |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1617 _OrthancPluginRetrieveDynamicString params; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1618 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
|
1619 params.argument = patientID; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1620 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
1621 if (context->InvokeService(context, _OrthancPluginService_LookupPatient, ¶ms) != OrthancPluginErrorCode_Success) |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1622 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1623 /* Error */ |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1624 return NULL; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1625 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1626 else |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1627 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1628 return result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1629 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1630 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1631 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1632 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1633 /** |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1634 * @brief Look for a study. |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1635 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1636 * 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
|
1637 * 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
|
1638 * over all the stored studies). |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1639 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1640 * @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
|
1641 * @param studyUID The Study Instance UID of interest. |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1642 * @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
|
1643 * Orthanc ID of the study. This string must be freed by OrthancPluginFreeString(). |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1644 * @ingroup Orthanc |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1645 **/ |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1646 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudy( |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1647 OrthancPluginContext* context, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1648 const char* studyUID) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1649 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1650 char* result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1651 |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1652 _OrthancPluginRetrieveDynamicString params; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1653 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
|
1654 params.argument = studyUID; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1655 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
1656 if (context->InvokeService(context, _OrthancPluginService_LookupStudy, ¶ms) != OrthancPluginErrorCode_Success) |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1657 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1658 /* Error */ |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1659 return NULL; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1660 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1661 else |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1662 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1663 return result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1664 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1665 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1666 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1667 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1668 /** |
1069
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1669 * @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
|
1670 * |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1671 * 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
|
1672 * 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
|
1673 * over all the stored studies). |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1674 * |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1675 * @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
|
1676 * @param accessionNumber The Accession Number of interest. |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1677 * @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
|
1678 * Orthanc ID of the study. This string must be freed by OrthancPluginFreeString(). |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1679 * @ingroup Orthanc |
1069
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1680 **/ |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1681 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudyWithAccessionNumber( |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1682 OrthancPluginContext* context, |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1683 const char* accessionNumber) |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1684 { |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1685 char* result; |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1686 |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1687 _OrthancPluginRetrieveDynamicString params; |
1069
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1688 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
|
1689 params.argument = accessionNumber; |
1069
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1690 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
1691 if (context->InvokeService(context, _OrthancPluginService_LookupStudyWithAccessionNumber, ¶ms) != OrthancPluginErrorCode_Success) |
1069
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1692 { |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1693 /* Error */ |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1694 return NULL; |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1695 } |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1696 else |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1697 { |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1698 return result; |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1699 } |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1700 } |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1701 |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1702 |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1703 /** |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1704 * @brief Look for a series. |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1705 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1706 * 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
|
1707 * 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
|
1708 * over all the stored series). |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1709 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1710 * @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
|
1711 * @param seriesUID The Series Instance UID of interest. |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1712 * @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
|
1713 * Orthanc ID of the series. This string must be freed by OrthancPluginFreeString(). |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1714 * @ingroup Orthanc |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1715 **/ |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1716 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupSeries( |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1717 OrthancPluginContext* context, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1718 const char* seriesUID) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1719 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1720 char* result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1721 |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1722 _OrthancPluginRetrieveDynamicString params; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1723 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
|
1724 params.argument = seriesUID; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1725 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
1726 if (context->InvokeService(context, _OrthancPluginService_LookupSeries, ¶ms) != OrthancPluginErrorCode_Success) |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1727 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1728 /* Error */ |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1729 return NULL; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1730 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1731 else |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1732 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1733 return result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1734 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1735 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1736 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1737 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1738 /** |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1739 * @brief Look for an instance. |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1740 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1741 * 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
|
1742 * 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
|
1743 * over all the stored instances). |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1744 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1745 * @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
|
1746 * @param sopInstanceUID The SOP Instance UID of interest. |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1747 * @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
|
1748 * Orthanc ID of the instance. This string must be freed by OrthancPluginFreeString(). |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1749 * @ingroup Orthanc |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1750 **/ |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1751 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupInstance( |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1752 OrthancPluginContext* context, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1753 const char* sopInstanceUID) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1754 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1755 char* result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1756 |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1757 _OrthancPluginRetrieveDynamicString params; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1758 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
|
1759 params.argument = sopInstanceUID; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1760 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
1761 if (context->InvokeService(context, _OrthancPluginService_LookupInstance, ¶ms) != OrthancPluginErrorCode_Success) |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1762 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1763 /* Error */ |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1764 return NULL; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1765 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1766 else |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1767 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1768 return result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1769 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1770 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1771 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1772 |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1773 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1774 typedef struct |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1775 { |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1776 OrthancPluginRestOutput* output; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1777 uint16_t status; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1778 } _OrthancPluginSendHttpStatusCode; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1779 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1780 /** |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1781 * @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
|
1782 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1783 * 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
|
1784 * 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
|
1785 * - 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
|
1786 * - 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
|
1787 * - 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
|
1788 * - 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
|
1789 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1790 * @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
|
1791 * @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
|
1792 * @param status The HTTP status code to be sent. |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1793 * @ingroup REST |
1594
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
1794 * @see OrthancPluginSendHttpStatus() |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1795 **/ |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1796 ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatusCode( |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1797 OrthancPluginContext* context, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1798 OrthancPluginRestOutput* output, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1799 uint16_t status) |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1800 { |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1801 _OrthancPluginSendHttpStatusCode params; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1802 params.output = output; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1803 params.status = status; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1804 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
|
1805 } |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1806 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1807 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1808 /** |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1809 * @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
|
1810 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1811 * 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
|
1812 * not authorized. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1813 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1814 * @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
|
1815 * @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
|
1816 * @param realm The realm for the authorization process. |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1817 * @ingroup REST |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1818 **/ |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1819 ORTHANC_PLUGIN_INLINE void OrthancPluginSendUnauthorized( |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1820 OrthancPluginContext* context, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1821 OrthancPluginRestOutput* output, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1822 const char* realm) |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1823 { |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1824 _OrthancPluginOutputPlusArgument params; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1825 params.output = output; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1826 params.argument = realm; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1827 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
|
1828 } |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1829 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1830 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1831 /** |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1832 * @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
|
1833 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1834 * 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
|
1835 * 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
|
1836 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1837 * @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
|
1838 * @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
|
1839 * @param allowedMethods The allowed methods for this URI (e.g. "GET,POST" after a PUT or a POST request). |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1840 * @ingroup REST |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1841 **/ |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1842 ORTHANC_PLUGIN_INLINE void OrthancPluginSendMethodNotAllowed( |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1843 OrthancPluginContext* context, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1844 OrthancPluginRestOutput* output, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1845 const char* allowedMethods) |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1846 { |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1847 _OrthancPluginOutputPlusArgument params; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1848 params.output = output; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1849 params.argument = allowedMethods; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1850 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
|
1851 } |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1852 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1853 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1854 typedef struct |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1855 { |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1856 OrthancPluginRestOutput* output; |
1137
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1857 const char* key; |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1858 const char* value; |
1137
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1859 } _OrthancPluginSetHttpHeader; |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1860 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1861 /** |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1862 * @brief Set a cookie. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1863 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1864 * 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
|
1865 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1866 * @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
|
1867 * @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
|
1868 * @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
|
1869 * @param value The value of the cookie. |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1870 * @ingroup REST |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1871 **/ |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1872 ORTHANC_PLUGIN_INLINE void OrthancPluginSetCookie( |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1873 OrthancPluginContext* context, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1874 OrthancPluginRestOutput* output, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1875 const char* cookie, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1876 const char* value) |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1877 { |
1137
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1878 _OrthancPluginSetHttpHeader params; |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1879 params.output = output; |
1137
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1880 params.key = cookie; |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1881 params.value = value; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1882 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
|
1883 } |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1884 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1885 |
1137
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1886 /** |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1887 * @brief Set some HTTP header. |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1888 * |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1889 * This function sets a HTTP header in the HTTP answer. |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1890 * |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1891 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1892 * @param output The HTTP connection to the client application. |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1893 * @param key The HTTP header to be set. |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1894 * @param value The value of the HTTP header. |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1895 * @ingroup REST |
1137
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1896 **/ |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1897 ORTHANC_PLUGIN_INLINE void OrthancPluginSetHttpHeader( |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1898 OrthancPluginContext* context, |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1899 OrthancPluginRestOutput* output, |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1900 const char* key, |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1901 const char* value) |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1902 { |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1903 _OrthancPluginSetHttpHeader params; |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1904 params.output = output; |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1905 params.key = key; |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1906 params.value = value; |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1907 context->InvokeService(context, _OrthancPluginService_SetHttpHeader, ¶ms); |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1908 } |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1909 |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1910 |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1911 typedef struct |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1912 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1913 char** resultStringToFree; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1914 const char** resultString; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1915 int64_t* resultInt64; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1916 const char* key; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1917 OrthancPluginDicomInstance* instance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1918 } _OrthancPluginAccessDicomInstance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1919 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1920 |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1921 /** |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1922 * @brief Get the AET of a DICOM instance. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1923 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1924 * 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
|
1925 * DICOM modality from which a DICOM instance originates. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1926 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1927 * @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
|
1928 * @param instance The instance of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1929 * @return The AET if success, NULL if error. |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1930 * @ingroup Callbacks |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1931 **/ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1932 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceRemoteAet( |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1933 OrthancPluginContext* context, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1934 OrthancPluginDicomInstance* instance) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1935 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1936 const char* result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1937 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1938 _OrthancPluginAccessDicomInstance params; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1939 memset(¶ms, 0, sizeof(params)); |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1940 params.resultString = &result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1941 params.instance = instance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1942 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
1943 if (context->InvokeService(context, _OrthancPluginService_GetInstanceRemoteAet, ¶ms) != OrthancPluginErrorCode_Success) |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1944 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1945 /* Error */ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1946 return NULL; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1947 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1948 else |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1949 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1950 return result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1951 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1952 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1953 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1954 |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1955 /** |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1956 * @brief Get the size of a DICOM file. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1957 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1958 * 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
|
1959 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1960 * @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
|
1961 * @param instance The instance of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1962 * @return The size of the file, -1 in case of error. |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1963 * @ingroup Callbacks |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1964 **/ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1965 ORTHANC_PLUGIN_INLINE int64_t OrthancPluginGetInstanceSize( |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1966 OrthancPluginContext* context, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1967 OrthancPluginDicomInstance* instance) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1968 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1969 int64_t size; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1970 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1971 _OrthancPluginAccessDicomInstance params; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1972 memset(¶ms, 0, sizeof(params)); |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1973 params.resultInt64 = &size; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1974 params.instance = instance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1975 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
1976 if (context->InvokeService(context, _OrthancPluginService_GetInstanceSize, ¶ms) != OrthancPluginErrorCode_Success) |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1977 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1978 /* Error */ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1979 return -1; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1980 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1981 else |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1982 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1983 return size; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1984 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1985 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1986 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1987 |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1988 /** |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1989 * @brief Get the data of a DICOM file. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1990 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1991 * 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
|
1992 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1993 * @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
|
1994 * @param instance The instance of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1995 * @return The pointer to the DICOM data, NULL in case of error. |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1996 * @ingroup Callbacks |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1997 **/ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1998 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceData( |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1999 OrthancPluginContext* context, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2000 OrthancPluginDicomInstance* instance) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2001 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2002 const char* result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2003 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2004 _OrthancPluginAccessDicomInstance params; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2005 memset(¶ms, 0, sizeof(params)); |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2006 params.resultString = &result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2007 params.instance = instance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2008 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2009 if (context->InvokeService(context, _OrthancPluginService_GetInstanceData, ¶ms) != OrthancPluginErrorCode_Success) |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2010 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2011 /* Error */ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2012 return NULL; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2013 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2014 else |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2015 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2016 return result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2017 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2018 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2019 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2020 |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2021 /** |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2022 * @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
|
2023 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2024 * 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
|
2025 * 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
|
2026 * of the given DICOM instance. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2027 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2028 * @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
|
2029 * @param instance The instance of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2030 * @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
|
2031 * This string must be freed by OrthancPluginFreeString(). |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
2032 * @ingroup Callbacks |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2033 **/ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2034 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceJson( |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2035 OrthancPluginContext* context, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2036 OrthancPluginDicomInstance* instance) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2037 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2038 char* result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2039 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2040 _OrthancPluginAccessDicomInstance params; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2041 memset(¶ms, 0, sizeof(params)); |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2042 params.resultStringToFree = &result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2043 params.instance = instance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2044 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2045 if (context->InvokeService(context, _OrthancPluginService_GetInstanceJson, ¶ms) != OrthancPluginErrorCode_Success) |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2046 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2047 /* Error */ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2048 return NULL; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2049 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2050 else |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2051 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2052 return result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2053 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2054 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2055 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2056 |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2057 /** |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2058 * @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
|
2059 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2060 * 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
|
2061 * 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
|
2062 * of the given DICOM instance. In contrast with |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2063 * ::OrthancPluginGetInstanceJson(), the returned JSON file is in |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2064 * its simplified version. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2065 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2066 * @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
|
2067 * @param instance The instance of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2068 * @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
|
2069 * This string must be freed by OrthancPluginFreeString(). |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
2070 * @ingroup Callbacks |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2071 **/ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2072 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceSimplifiedJson( |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2073 OrthancPluginContext* context, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2074 OrthancPluginDicomInstance* instance) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2075 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2076 char* result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2077 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2078 _OrthancPluginAccessDicomInstance params; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2079 memset(¶ms, 0, sizeof(params)); |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2080 params.resultStringToFree = &result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2081 params.instance = instance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2082 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2083 if (context->InvokeService(context, _OrthancPluginService_GetInstanceSimplifiedJson, ¶ms) != OrthancPluginErrorCode_Success) |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2084 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2085 /* Error */ |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2086 return NULL; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2087 } |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2088 else |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2089 { |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2090 return result; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2091 } |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2092 } |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2093 |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2094 |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2095 /** |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2096 * @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
|
2097 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2098 * 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
|
2099 * 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
|
2100 * callbacks registered by |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2101 * ::OrthancPluginRegisterOnStoredInstanceCallback(), the only |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2102 * possibly available metadata are "ReceptionDate", "RemoteAET" and |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2103 * "IndexInSeries". |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2104 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2105 * @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
|
2106 * @param instance The instance of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2107 * @param metadata The metadata of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2108 * @return 1 if the metadata is present, 0 if it is absent, -1 in case of error. |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
2109 * @ingroup Callbacks |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2110 **/ |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2111 ORTHANC_PLUGIN_INLINE int OrthancPluginHasInstanceMetadata( |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2112 OrthancPluginContext* context, |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2113 OrthancPluginDicomInstance* instance, |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2114 const char* metadata) |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2115 { |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2116 int64_t result; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2117 |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2118 _OrthancPluginAccessDicomInstance params; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2119 memset(¶ms, 0, sizeof(params)); |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2120 params.resultInt64 = &result; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2121 params.instance = instance; |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2122 params.key = metadata; |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2123 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2124 if (context->InvokeService(context, _OrthancPluginService_HasInstanceMetadata, ¶ms) != OrthancPluginErrorCode_Success) |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2125 { |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2126 /* Error */ |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2127 return -1; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2128 } |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2129 else |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2130 { |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2131 return (result != 0); |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2132 } |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2133 } |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2134 |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2135 |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2136 /** |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2137 * @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
|
2138 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2139 * 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
|
2140 * 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
|
2141 * ::OrthancPluginHasInstanceMetadata(). |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2142 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2143 * @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
|
2144 * @param instance The instance of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2145 * @param metadata The metadata of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2146 * @return The metadata value if success, NULL if error. |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
2147 * @ingroup Callbacks |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2148 **/ |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2149 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceMetadata( |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2150 OrthancPluginContext* context, |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2151 OrthancPluginDicomInstance* instance, |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2152 const char* metadata) |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2153 { |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2154 const char* result; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2155 |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2156 _OrthancPluginAccessDicomInstance params; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2157 memset(¶ms, 0, sizeof(params)); |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2158 params.resultString = &result; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2159 params.instance = instance; |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2160 params.key = metadata; |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2161 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2162 if (context->InvokeService(context, _OrthancPluginService_GetInstanceMetadata, ¶ms) != OrthancPluginErrorCode_Success) |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2163 { |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2164 /* Error */ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2165 return NULL; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2166 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2167 else |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2168 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2169 return result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2170 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2171 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2172 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2173 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2174 |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2175 typedef struct |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2176 { |
1295 | 2177 OrthancPluginStorageCreate create; |
2178 OrthancPluginStorageRead read; | |
2179 OrthancPluginStorageRemove remove; | |
2180 OrthancPluginFree free; | |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2181 } _OrthancPluginRegisterStorageArea; |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2182 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2183 /** |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2184 * @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
|
2185 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2186 * 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
|
2187 * 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
|
2188 * 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
|
2189 * 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
|
2190 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2191 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
1141 | 2192 * @param create The callback function to store a file on the custom storage area. |
2193 * @param read The callback function to read a file from the custom storage area. | |
2194 * @param remove The callback function to remove a file from the custom storage area. | |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
2195 * @ingroup Callbacks |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2196 **/ |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2197 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
|
2198 OrthancPluginContext* context, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2199 OrthancPluginStorageCreate create, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2200 OrthancPluginStorageRead read, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2201 OrthancPluginStorageRemove remove) |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2202 { |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2203 _OrthancPluginRegisterStorageArea params; |
1295 | 2204 params.create = create; |
2205 params.read = read; | |
2206 params.remove = remove; | |
1136
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1135
diff
changeset
|
2207 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1135
diff
changeset
|
2208 #ifdef __cplusplus |
1295 | 2209 params.free = ::free; |
1136
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1135
diff
changeset
|
2210 #else |
1295 | 2211 params.free = free; |
1136
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1135
diff
changeset
|
2212 #endif |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1135
diff
changeset
|
2213 |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2214 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
|
2215 } |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2216 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2217 |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2218 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2219 /** |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2220 * @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
|
2221 * |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2222 * 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
|
2223 * |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2224 * @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
|
2225 * @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
|
2226 * 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
|
2227 * OrthancPluginFreeString(). |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2228 **/ |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2229 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
|
2230 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2231 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
|
2232 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2233 _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
|
2234 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
|
2235 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
|
2236 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2237 if (context->InvokeService(context, _OrthancPluginService_GetOrthancPath, ¶ms) != OrthancPluginErrorCode_Success) |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2238 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2239 /* Error */ |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2240 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
|
2241 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2242 else |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2243 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2244 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
|
2245 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2246 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2247 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2248 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2249 /** |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2250 * @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
|
2251 * |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2252 * 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
|
2253 * |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2254 * @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
|
2255 * @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
|
2256 * 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
|
2257 * OrthancPluginFreeString(). |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2258 **/ |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2259 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
|
2260 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2261 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
|
2262 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2263 _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
|
2264 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
|
2265 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
|
2266 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2267 if (context->InvokeService(context, _OrthancPluginService_GetOrthancDirectory, ¶ms) != OrthancPluginErrorCode_Success) |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2268 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2269 /* Error */ |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2270 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
|
2271 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2272 else |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2273 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2274 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
|
2275 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2276 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2277 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2278 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2279 /** |
1423
7b7d597a190c
The configuration can be splitted into several files stored inside the same folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1407
diff
changeset
|
2280 * @brief Return the path to the configuration file(s). |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2281 * |
1423
7b7d597a190c
The configuration can be splitted into several files stored inside the same folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1407
diff
changeset
|
2282 * This function returns the path to the configuration file(s) that |
7b7d597a190c
The configuration can be splitted into several files stored inside the same folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1407
diff
changeset
|
2283 * was specified when starting Orthanc. Since version 0.9.1, this |
7b7d597a190c
The configuration can be splitted into several files stored inside the same folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1407
diff
changeset
|
2284 * path can refer to a folder that stores a set of configuration |
1424
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2285 * files. This function is deprecated in favor of |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2286 * OrthancPluginGetConfiguration(). |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2287 * |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2288 * @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
|
2289 * @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
|
2290 * 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
|
2291 * OrthancPluginFreeString(). |
1424
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2292 * @see OrthancPluginGetConfiguration() |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2293 **/ |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2294 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
|
2295 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2296 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
|
2297 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2298 _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
|
2299 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
|
2300 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
|
2301 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2302 if (context->InvokeService(context, _OrthancPluginService_GetConfigurationPath, ¶ms) != OrthancPluginErrorCode_Success) |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2303 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2304 /* Error */ |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2305 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
|
2306 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2307 else |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2308 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2309 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
|
2310 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2311 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2312 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2313 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2314 |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2315 typedef struct |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2316 { |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2317 OrthancPluginOnChangeCallback callback; |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2318 } _OrthancPluginOnChangeCallback; |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2319 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2320 /** |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2321 * @brief Register a callback to monitor changes. |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2322 * |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2323 * 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
|
2324 * whenever a change happens to some DICOM resource. |
1642
0669d05b6de1
warning about OrthancPluginRegisterOnChangeCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1630
diff
changeset
|
2325 * |
0669d05b6de1
warning about OrthancPluginRegisterOnChangeCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1630
diff
changeset
|
2326 * @warning If your change callback has to call the REST API of |
0669d05b6de1
warning about OrthancPluginRegisterOnChangeCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1630
diff
changeset
|
2327 * Orthanc, you should make these calls in a separate thread (with |
0669d05b6de1
warning about OrthancPluginRegisterOnChangeCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1630
diff
changeset
|
2328 * the events passing through a message queue). Otherwise, this |
0669d05b6de1
warning about OrthancPluginRegisterOnChangeCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1630
diff
changeset
|
2329 * could result in deadlocks in the presence of other plugins or Lua |
0669d05b6de1
warning about OrthancPluginRegisterOnChangeCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1630
diff
changeset
|
2330 * script. |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2331 * |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2332 * @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
|
2333 * @param callback The callback function. |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
2334 * @ingroup Callbacks |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2335 **/ |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2336 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnChangeCallback( |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2337 OrthancPluginContext* context, |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2338 OrthancPluginOnChangeCallback callback) |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2339 { |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2340 _OrthancPluginOnChangeCallback params; |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2341 params.callback = callback; |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2342 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2343 context->InvokeService(context, _OrthancPluginService_RegisterOnChangeCallback, ¶ms); |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2344 } |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2345 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2346 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2347 |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2348 typedef struct |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2349 { |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2350 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
|
2351 _OrthancPluginProperty property; |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2352 const char* value; |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2353 } _OrthancPluginSetPluginProperty; |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2354 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2355 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2356 /** |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2357 * @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
|
2358 * |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2359 * 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
|
2360 * 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
|
2361 * 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
|
2362 * Explorer. |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2363 * |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2364 * @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
|
2365 * @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
|
2366 **/ |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2367 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
|
2368 OrthancPluginContext* context, |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2369 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
|
2370 { |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2371 _OrthancPluginSetPluginProperty params; |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2372 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
|
2373 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
|
2374 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
|
2375 |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2376 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, ¶ms); |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2377 } |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2378 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2379 |
1233 | 2380 /** |
2381 * @brief Set a description for this plugin. | |
2382 * | |
2383 * Set a description for this plugin. It is displayed in the | |
2384 * "Plugins" page of Orthanc Explorer. | |
2385 * | |
2386 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
2387 * @param description The description. | |
2388 **/ | |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2389 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
|
2390 OrthancPluginContext* context, |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2391 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
|
2392 { |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2393 _OrthancPluginSetPluginProperty params; |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2394 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
|
2395 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
|
2396 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
|
2397 |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2398 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, ¶ms); |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2399 } |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2400 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2401 |
1233 | 2402 /** |
2403 * @brief Extend the JavaScript code of Orthanc Explorer. | |
2404 * | |
2405 * Add JavaScript code to customize the default behavior of Orthanc | |
2406 * Explorer. This can for instance be used to add new buttons. | |
2407 * | |
2408 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
2409 * @param javascript The custom JavaScript code. | |
2410 **/ | |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2411 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
|
2412 OrthancPluginContext* context, |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2413 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
|
2414 { |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2415 _OrthancPluginSetPluginProperty params; |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2416 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
|
2417 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
|
2418 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
|
2419 |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2420 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, ¶ms); |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2421 } |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2422 |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2423 |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2424 typedef struct |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2425 { |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2426 char** result; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2427 int32_t property; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2428 const char* value; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2429 } _OrthancPluginGlobalProperty; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2430 |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2431 |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2432 /** |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2433 * @brief Get the value of a global property. |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2434 * |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2435 * Get the value of a global property that is stored in the Orthanc database. Global |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2436 * properties whose index is below 1024 are reserved by Orthanc. |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2437 * |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2438 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2439 * @param property The global property of interest. |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2440 * @param defaultValue The value to return, if the global property is unset. |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2441 * @return The value of the global property, or NULL in the case of an error. This |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2442 * string must be freed by OrthancPluginFreeString(). |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
2443 * @ingroup Orthanc |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2444 **/ |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2445 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetGlobalProperty( |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2446 OrthancPluginContext* context, |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2447 int32_t property, |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2448 const char* defaultValue) |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2449 { |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2450 char* result; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2451 |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2452 _OrthancPluginGlobalProperty params; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2453 params.result = &result; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2454 params.property = property; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2455 params.value = defaultValue; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2456 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2457 if (context->InvokeService(context, _OrthancPluginService_GetGlobalProperty, ¶ms) != OrthancPluginErrorCode_Success) |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2458 { |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2459 /* Error */ |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2460 return NULL; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2461 } |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2462 else |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2463 { |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2464 return result; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2465 } |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2466 } |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2467 |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2468 |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2469 /** |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2470 * @brief Set the value of a global property. |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2471 * |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2472 * Set the value of a global property into the Orthanc |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2473 * database. Setting a global property can be used by plugins to |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2474 * save their internal parameters. Plugins are only allowed to set |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2475 * properties whose index are above or equal to 1024 (properties |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2476 * below 1024 are read-only and reserved by Orthanc). |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2477 * |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2478 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2479 * @param property The global property of interest. |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2480 * @param value The value to be set in the global property. |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
2481 * @return 0 if success, or the error code if failure. |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
2482 * @ingroup Orthanc |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2483 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
2484 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSetGlobalProperty( |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2485 OrthancPluginContext* context, |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2486 int32_t property, |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2487 const char* value) |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2488 { |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2489 _OrthancPluginGlobalProperty params; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2490 params.result = NULL; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2491 params.property = property; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2492 params.value = value; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2493 |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
2494 return context->InvokeService(context, _OrthancPluginService_SetGlobalProperty, ¶ms); |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2495 } |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2496 |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2497 |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2498 |
1280
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2499 typedef struct |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2500 { |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2501 int32_t *resultInt32; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2502 uint32_t *resultUint32; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2503 int64_t *resultInt64; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2504 uint64_t *resultUint64; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2505 } _OrthancPluginReturnSingleValue; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2506 |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2507 /** |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2508 * @brief Get the number of command-line arguments. |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2509 * |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2510 * Retrieve the number of command-line arguments that were used to launch Orthanc. |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2511 * |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2512 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2513 * @return The number of arguments. |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2514 **/ |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2515 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetCommandLineArgumentsCount( |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2516 OrthancPluginContext* context) |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2517 { |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2518 uint32_t count = 0; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2519 |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2520 _OrthancPluginReturnSingleValue params; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2521 memset(¶ms, 0, sizeof(params)); |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2522 params.resultUint32 = &count; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2523 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2524 if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgumentsCount, ¶ms) != OrthancPluginErrorCode_Success) |
1280
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2525 { |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2526 /* Error */ |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2527 return 0; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2528 } |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2529 else |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2530 { |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2531 return count; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2532 } |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2533 } |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2534 |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2535 |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2536 |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2537 /** |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2538 * @brief Get the value of a command-line argument. |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2539 * |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2540 * Get the value of one of the command-line arguments that were used |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2541 * to launch Orthanc. The number of available arguments can be |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2542 * retrieved by OrthancPluginGetCommandLineArgumentsCount(). |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2543 * |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2544 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2545 * @param argument The index of the argument. |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2546 * @return The value of the argument, or NULL in the case of an error. This |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2547 * string must be freed by OrthancPluginFreeString(). |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2548 **/ |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2549 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetCommandLineArgument( |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2550 OrthancPluginContext* context, |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2551 uint32_t argument) |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2552 { |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2553 char* result; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2554 |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2555 _OrthancPluginGlobalProperty params; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2556 params.result = &result; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2557 params.property = (int32_t) argument; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2558 params.value = NULL; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2559 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2560 if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgument, ¶ms) != OrthancPluginErrorCode_Success) |
1280
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2561 { |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2562 /* Error */ |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2563 return NULL; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2564 } |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2565 else |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2566 { |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2567 return result; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2568 } |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2569 } |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2570 |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2571 |
1407
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2572 /** |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2573 * @brief Get the expected version of the database schema. |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2574 * |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2575 * Retrieve the expected version of the database schema. |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2576 * |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2577 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2578 * @return The version. |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
2579 * @ingroup Callbacks |
1615
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
2580 * @deprecated Please instead use IDatabaseBackend::UpgradeDatabase() |
1407
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2581 **/ |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2582 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetExpectedDatabaseVersion( |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2583 OrthancPluginContext* context) |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2584 { |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2585 uint32_t count = 0; |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2586 |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2587 _OrthancPluginReturnSingleValue params; |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2588 memset(¶ms, 0, sizeof(params)); |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2589 params.resultUint32 = &count; |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2590 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2591 if (context->InvokeService(context, _OrthancPluginService_GetExpectedDatabaseVersion, ¶ms) != OrthancPluginErrorCode_Success) |
1407
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2592 { |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2593 /* Error */ |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2594 return 0; |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2595 } |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2596 else |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2597 { |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2598 return count; |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2599 } |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2600 } |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2601 |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2602 |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2603 |
1424
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2604 /** |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2605 * @brief Return the content of the configuration file(s). |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2606 * |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2607 * This function returns the content of the configuration that is |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2608 * used by Orthanc, formatted as a JSON string. |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2609 * |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2610 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2611 * @return NULL in the case of an error, or a newly allocated string |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2612 * containing the configuration. This string must be freed by |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2613 * OrthancPluginFreeString(). |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2614 **/ |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2615 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfiguration(OrthancPluginContext* context) |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2616 { |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2617 char* result; |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2618 |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2619 _OrthancPluginRetrieveDynamicString params; |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2620 params.result = &result; |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2621 params.argument = NULL; |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2622 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2623 if (context->InvokeService(context, _OrthancPluginService_GetConfiguration, ¶ms) != OrthancPluginErrorCode_Success) |
1424
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2624 { |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2625 /* Error */ |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2626 return NULL; |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2627 } |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2628 else |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2629 { |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2630 return result; |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2631 } |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2632 } |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2633 |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2634 |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2635 |
1430
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2636 typedef struct |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2637 { |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2638 OrthancPluginRestOutput* output; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2639 const char* subType; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2640 const char* contentType; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2641 } _OrthancPluginStartMultipartAnswer; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2642 |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2643 /** |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2644 * @brief Start an HTTP multipart answer. |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2645 * |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2646 * Initiates a HTTP multipart answer, as the result of a REST request. |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2647 * |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2648 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2649 * @param output The HTTP connection to the client application. |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2650 * @param subType The sub-type of the multipart answer ("mixed" or "related"). |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2651 * @param contentType The MIME type of the items in the multipart answer. |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
2652 * @return 0 if success, or the error code if failure. |
1430
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2653 * @see OrthancPluginSendMultipartItem() |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
2654 * @ingroup REST |
1430
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2655 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
2656 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStartMultipartAnswer( |
1430
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2657 OrthancPluginContext* context, |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2658 OrthancPluginRestOutput* output, |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2659 const char* subType, |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2660 const char* contentType) |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2661 { |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2662 _OrthancPluginStartMultipartAnswer params; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2663 params.output = output; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2664 params.subType = subType; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2665 params.contentType = contentType; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2666 return context->InvokeService(context, _OrthancPluginService_StartMultipartAnswer, ¶ms); |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2667 } |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2668 |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2669 |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2670 /** |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2671 * @brief Send an item as a part of some HTTP multipart answer. |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2672 * |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2673 * This function sends an item as a part of some HTTP multipart |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2674 * answer that was initiated by OrthancPluginStartMultipartAnswer(). |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2675 * |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2676 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2677 * @param output The HTTP connection to the client application. |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2678 * @param answer Pointer to the memory buffer containing the item. |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2679 * @param answerSize Number of bytes of the item. |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
2680 * @return 0 if success, or the error code if failure (this notably happens |
1430
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2681 * if the connection is closed by the client). |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
2682 * @ingroup REST |
1430
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2683 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
2684 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSendMultipartItem( |
1430
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2685 OrthancPluginContext* context, |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2686 OrthancPluginRestOutput* output, |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2687 const char* answer, |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2688 uint32_t answerSize) |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2689 { |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2690 _OrthancPluginAnswerBuffer params; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2691 params.output = output; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2692 params.answer = answer; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2693 params.answerSize = answerSize; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2694 params.mimeType = NULL; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2695 return context->InvokeService(context, _OrthancPluginService_SendMultipartItem, ¶ms); |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2696 } |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2697 |
1554
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2698 |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2699 |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2700 typedef struct |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2701 { |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2702 OrthancPluginMemoryBuffer* target; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2703 const void* source; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2704 uint32_t size; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2705 OrthancPluginCompressionType compression; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2706 uint8_t uncompress; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2707 } _OrthancPluginBufferCompression; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2708 |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2709 |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2710 /** |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2711 * @brief Compress or decompress a buffer. |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2712 * |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2713 * This function compresses or decompresses a buffer, using the |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2714 * version of the zlib library that is used by the Orthanc core. |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2715 * |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2716 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2717 * @param target The target memory buffer. |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2718 * @param source The source buffer. |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2719 * @param size The size in bytes of the source buffer. |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2720 * @param compression The compression algorithm. |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2721 * @param uncompress If set to "0", the buffer must be compressed. |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2722 * If set to "1", the buffer must be uncompressed. |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
2723 * @return 0 if success, or the error code if failure. |
1613
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
2724 * @ingroup Images |
1554
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2725 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
2726 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginBufferCompression( |
1554
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2727 OrthancPluginContext* context, |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2728 OrthancPluginMemoryBuffer* target, |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2729 const void* source, |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2730 uint32_t size, |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2731 OrthancPluginCompressionType compression, |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2732 uint8_t uncompress) |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2733 { |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2734 _OrthancPluginBufferCompression params; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2735 params.target = target; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2736 params.source = source; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2737 params.size = size; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2738 params.compression = compression; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2739 params.uncompress = uncompress; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2740 |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2741 return context->InvokeService(context, _OrthancPluginService_BufferCompression, ¶ms); |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2742 } |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2743 |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2744 |
1588
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2745 |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2746 typedef struct |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2747 { |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2748 OrthancPluginMemoryBuffer* target; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2749 const char* path; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2750 } _OrthancPluginReadFile; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2751 |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2752 /** |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2753 * @brief Read a file. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2754 * |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2755 * Read the content of a file on the filesystem, and returns it into |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2756 * a newly allocated memory buffer. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2757 * |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2758 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2759 * @param target The target memory buffer. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2760 * @param path The path of the file to be read. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2761 * @return 0 if success, or the error code if failure. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2762 **/ |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2763 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginReadFile( |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2764 OrthancPluginContext* context, |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2765 OrthancPluginMemoryBuffer* target, |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2766 const char* path) |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2767 { |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2768 _OrthancPluginReadFile params; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2769 params.target = target; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2770 params.path = path; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2771 return context->InvokeService(context, _OrthancPluginService_ReadFile, ¶ms); |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2772 } |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2773 |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2774 |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2775 |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2776 typedef struct |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2777 { |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2778 const char* path; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2779 const void* data; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2780 uint32_t size; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2781 } _OrthancPluginWriteFile; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2782 |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2783 /** |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2784 * @brief Write a file. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2785 * |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2786 * Write the content of a memory buffer to the filesystem. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2787 * |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2788 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2789 * @param path The path of the file to be written. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2790 * @param data The content of the memory buffer. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2791 * @param size The size of the memory buffer. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2792 * @return 0 if success, or the error code if failure. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2793 **/ |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2794 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWriteFile( |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2795 OrthancPluginContext* context, |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2796 const char* path, |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2797 const void* data, |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2798 uint32_t size) |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2799 { |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2800 _OrthancPluginWriteFile params; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2801 params.path = path; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2802 params.data = data; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2803 params.size = size; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2804 return context->InvokeService(context, _OrthancPluginService_WriteFile, ¶ms); |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2805 } |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2806 |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2807 |
1593
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2808 |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2809 typedef struct |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2810 { |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2811 const char** target; |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2812 OrthancPluginErrorCode error; |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2813 } _OrthancPluginGetErrorDescription; |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2814 |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2815 /** |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2816 * @brief Get the description of a given error code. |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2817 * |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2818 * This function returns the description of a given error code. |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2819 * |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2820 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
1595
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
2821 * @param error The error code of interest. |
1593
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2822 * @return The error description. This is a statically-allocated |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2823 * string, do not free it. |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2824 **/ |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2825 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetErrorDescription( |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2826 OrthancPluginContext* context, |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2827 OrthancPluginErrorCode error) |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2828 { |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2829 const char* result = NULL; |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2830 |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2831 _OrthancPluginGetErrorDescription params; |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2832 params.target = &result; |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2833 params.error = error; |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2834 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2835 if (context->InvokeService(context, _OrthancPluginService_GetErrorDescription, ¶ms) != OrthancPluginErrorCode_Success || |
1593
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2836 result == NULL) |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2837 { |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2838 return "Unknown error code"; |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2839 } |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2840 else |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2841 { |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2842 return result; |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2843 } |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2844 } |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2845 |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2846 |
1594
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2847 |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2848 typedef struct |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2849 { |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2850 OrthancPluginRestOutput* output; |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2851 uint16_t status; |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2852 const char* body; |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2853 uint32_t bodySize; |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2854 } _OrthancPluginSendHttpStatus; |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2855 |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2856 /** |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2857 * @brief Send a HTTP status, with a custom body. |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2858 * |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2859 * This function answers to a HTTP request by sending a HTTP status |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2860 * code (such as "400 - Bad Request"), together with a body |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2861 * describing the error. The body will only be returned if the |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2862 * configuration option "HttpDescribeErrors" of Orthanc is set to "true". |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2863 * |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2864 * Note that: |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2865 * - Successful requests (status 200) must use ::OrthancPluginAnswerBuffer(). |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2866 * - Redirections (status 301) must use ::OrthancPluginRedirect(). |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2867 * - Unauthorized access (status 401) must use ::OrthancPluginSendUnauthorized(). |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2868 * - Methods not allowed (status 405) must use ::OrthancPluginSendMethodNotAllowed(). |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2869 * |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2870 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2871 * @param output The HTTP connection to the client application. |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2872 * @param status The HTTP status code to be sent. |
1595
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
2873 * @param body The body of the answer. |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
2874 * @param bodySize The size of the body. |
1594
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2875 * @see OrthancPluginSendHttpStatusCode() |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
2876 * @ingroup REST |
1594
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2877 **/ |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2878 ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatus( |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2879 OrthancPluginContext* context, |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2880 OrthancPluginRestOutput* output, |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2881 uint16_t status, |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2882 const char* body, |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2883 uint32_t bodySize) |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2884 { |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2885 _OrthancPluginSendHttpStatus params; |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2886 params.output = output; |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2887 params.status = status; |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2888 params.body = body; |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2889 params.bodySize = bodySize; |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2890 context->InvokeService(context, _OrthancPluginService_SendHttpStatus, ¶ms); |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2891 } |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2892 |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2893 |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2894 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2895 typedef struct |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2896 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2897 const OrthancPluginImage* image; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2898 uint32_t* resultUint32; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2899 OrthancPluginPixelFormat* resultPixelFormat; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2900 const void** resultBuffer; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2901 } _OrthancPluginGetImageInfo; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2902 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2903 |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2904 /** |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2905 * @brief Return the pixel format of an image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2906 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2907 * This function returns the type of memory layout for the pixels of the given image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2908 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2909 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2910 * @param image The image of interest. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2911 * @return The pixel format. |
1613
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
2912 * @ingroup Images |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2913 **/ |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2914 ORTHANC_PLUGIN_INLINE OrthancPluginPixelFormat OrthancPluginGetImagePixelFormat( |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2915 OrthancPluginContext* context, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2916 const OrthancPluginImage* image) |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2917 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2918 OrthancPluginPixelFormat target; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2919 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2920 _OrthancPluginGetImageInfo params; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2921 memset(¶ms, 0, sizeof(params)); |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2922 params.image = image; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2923 params.resultPixelFormat = ⌖ |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2924 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2925 if (context->InvokeService(context, _OrthancPluginService_GetImagePixelFormat, ¶ms) != OrthancPluginErrorCode_Success) |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2926 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2927 return OrthancPluginPixelFormat_Unknown; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2928 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2929 else |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2930 { |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2931 return (OrthancPluginPixelFormat) target; |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2932 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2933 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2934 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2935 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2936 |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2937 /** |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2938 * @brief Return the width of an image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2939 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2940 * This function returns the width of the given image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2941 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2942 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2943 * @param image The image of interest. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2944 * @return The width. |
1613
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
2945 * @ingroup Images |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2946 **/ |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2947 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageWidth( |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2948 OrthancPluginContext* context, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2949 const OrthancPluginImage* image) |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2950 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2951 uint32_t width; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2952 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2953 _OrthancPluginGetImageInfo params; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2954 memset(¶ms, 0, sizeof(params)); |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2955 params.image = image; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2956 params.resultUint32 = &width; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2957 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2958 if (context->InvokeService(context, _OrthancPluginService_GetImageWidth, ¶ms) != OrthancPluginErrorCode_Success) |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2959 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2960 return 0; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2961 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2962 else |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2963 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2964 return width; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2965 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2966 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2967 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2968 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2969 |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2970 /** |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2971 * @brief Return the height of an image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2972 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2973 * This function returns the height of the given image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2974 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2975 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2976 * @param image The image of interest. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2977 * @return The height. |
1613
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
2978 * @ingroup Images |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2979 **/ |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2980 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageHeight( |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2981 OrthancPluginContext* context, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2982 const OrthancPluginImage* image) |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2983 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2984 uint32_t height; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2985 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2986 _OrthancPluginGetImageInfo params; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2987 memset(¶ms, 0, sizeof(params)); |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2988 params.image = image; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2989 params.resultUint32 = &height; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2990 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2991 if (context->InvokeService(context, _OrthancPluginService_GetImageHeight, ¶ms) != OrthancPluginErrorCode_Success) |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2992 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2993 return 0; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2994 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2995 else |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2996 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2997 return height; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2998 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2999 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3000 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3001 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3002 |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3003 /** |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3004 * @brief Return the pitch of an image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3005 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3006 * This function returns the pitch of the given image. The pitch is |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3007 * defined as the number of bytes between 2 successive lines of the |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3008 * image in the memory buffer. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3009 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3010 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3011 * @param image The image of interest. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3012 * @return The pitch. |
1613
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3013 * @ingroup Images |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3014 **/ |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3015 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImagePitch( |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3016 OrthancPluginContext* context, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3017 const OrthancPluginImage* image) |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3018 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3019 uint32_t pitch; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3020 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3021 _OrthancPluginGetImageInfo params; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3022 memset(¶ms, 0, sizeof(params)); |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3023 params.image = image; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3024 params.resultUint32 = &pitch; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3025 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
3026 if (context->InvokeService(context, _OrthancPluginService_GetImagePitch, ¶ms) != OrthancPluginErrorCode_Success) |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3027 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3028 return 0; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3029 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3030 else |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3031 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3032 return pitch; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3033 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3034 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3035 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3036 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3037 |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3038 /** |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3039 * @brief Return a pointer to the content of an image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3040 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3041 * This function returns a pointer to the memory buffer that |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3042 * contains the pixels of the image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3043 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3044 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3045 * @param image The image of interest. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3046 * @return The pointer. |
1613
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3047 * @ingroup Images |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3048 **/ |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3049 ORTHANC_PLUGIN_INLINE const void* OrthancPluginGetImageBuffer( |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3050 OrthancPluginContext* context, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3051 const OrthancPluginImage* image) |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3052 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3053 const void* target = NULL; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3054 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3055 _OrthancPluginGetImageInfo params; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3056 memset(¶ms, 0, sizeof(params)); |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3057 params.resultBuffer = ⌖ |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3058 params.image = image; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3059 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
3060 if (context->InvokeService(context, _OrthancPluginService_GetImageBuffer, ¶ms) != OrthancPluginErrorCode_Success) |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3061 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3062 return NULL; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3063 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3064 else |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3065 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3066 return target; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3067 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3068 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3069 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3070 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3071 typedef struct |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3072 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3073 OrthancPluginImage** target; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3074 const void* data; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3075 uint32_t size; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3076 OrthancPluginImageFormat format; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3077 } _OrthancPluginUncompressImage; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3078 |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3079 |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3080 /** |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3081 * @brief Decode a compressed image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3082 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3083 * This function decodes a compressed image from a memory buffer. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3084 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3085 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3086 * @param data Pointer to a memory buffer containing the compressed image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3087 * @param size Size of the memory buffer containing the compressed image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3088 * @param format The file format of the compressed image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3089 * @return The uncompressed image. It must be freed with OrthancPluginFreeImage(). |
1613
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3090 * @ingroup Images |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3091 **/ |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3092 ORTHANC_PLUGIN_INLINE OrthancPluginImage *OrthancPluginUncompressImage( |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3093 OrthancPluginContext* context, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3094 const void* data, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3095 uint32_t size, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3096 OrthancPluginImageFormat format) |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3097 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3098 OrthancPluginImage* target = NULL; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3099 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3100 _OrthancPluginUncompressImage params; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3101 memset(¶ms, 0, sizeof(params)); |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3102 params.target = ⌖ |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3103 params.data = data; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3104 params.size = size; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3105 params.format = format; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3106 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
3107 if (context->InvokeService(context, _OrthancPluginService_UncompressImage, ¶ms) != OrthancPluginErrorCode_Success) |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3108 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3109 return NULL; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3110 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3111 else |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3112 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3113 return target; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3114 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3115 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3116 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3117 |
1605 | 3118 |
3119 | |
3120 typedef struct | |
3121 { | |
3122 OrthancPluginImage* image; | |
3123 } _OrthancPluginFreeImage; | |
3124 | |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3125 /** |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3126 * @brief Free an image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3127 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3128 * This function frees an image that was decoded with OrthancPluginUncompressImage(). |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3129 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3130 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3131 * @param image The image. |
1613
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3132 * @ingroup Images |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3133 **/ |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3134 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeImage( |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3135 OrthancPluginContext* context, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3136 OrthancPluginImage* image) |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3137 { |
1605 | 3138 _OrthancPluginFreeImage params; |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3139 params.image = image; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3140 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3141 context->InvokeService(context, _OrthancPluginService_FreeImage, ¶ms); |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3142 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3143 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3144 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3145 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3146 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3147 typedef struct |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3148 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3149 OrthancPluginMemoryBuffer* target; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3150 OrthancPluginImageFormat imageFormat; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3151 OrthancPluginPixelFormat pixelFormat; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3152 uint32_t width; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3153 uint32_t height; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3154 uint32_t pitch; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3155 const void* buffer; |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
3156 uint8_t quality; |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3157 } _OrthancPluginCompressImage; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3158 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3159 |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3160 /** |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
3161 * @brief Encode a PNG image. |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3162 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3163 * This function compresses the given memory buffer containing an |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3164 * image using the PNG specification, and stores the result of the |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3165 * compression into a newly allocated memory buffer. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3166 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3167 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3168 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer(). |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3169 * @param format The memory layout of the uncompressed image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3170 * @param width The width of the image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3171 * @param height The height of the image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3172 * @param pitch The pitch of the image (i.e. the number of bytes |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3173 * between 2 successive lines of the image in the memory buffer). |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3174 * @param buffer The memory buffer containing the uncompressed image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3175 * @return 0 if success, or the error code if failure. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3176 * @see OrthancPluginCompressAndAnswerPngImage() |
1613
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3177 * @ingroup Images |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3178 **/ |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3179 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCompressPngImage( |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3180 OrthancPluginContext* context, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3181 OrthancPluginMemoryBuffer* target, |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3182 OrthancPluginPixelFormat format, |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3183 uint32_t width, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3184 uint32_t height, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3185 uint32_t pitch, |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
3186 const void* buffer) |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3187 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3188 _OrthancPluginCompressImage params; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3189 memset(¶ms, 0, sizeof(params)); |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3190 params.target = target; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3191 params.imageFormat = OrthancPluginImageFormat_Png; |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3192 params.pixelFormat = format; |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3193 params.width = width; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3194 params.height = height; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3195 params.pitch = pitch; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3196 params.buffer = buffer; |
1613
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3197 params.quality = 0; /* Unused for PNG */ |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3198 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3199 return context->InvokeService(context, _OrthancPluginService_CompressImage, ¶ms); |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3200 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3201 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3202 |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3203 /** |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
3204 * @brief Encode a JPEG image. |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3205 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3206 * This function compresses the given memory buffer containing an |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3207 * image using the JPEG specification, and stores the result of the |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3208 * compression into a newly allocated memory buffer. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3209 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3210 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3211 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer(). |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3212 * @param format The memory layout of the uncompressed image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3213 * @param width The width of the image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3214 * @param height The height of the image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3215 * @param pitch The pitch of the image (i.e. the number of bytes |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3216 * between 2 successive lines of the image in the memory buffer). |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3217 * @param buffer The memory buffer containing the uncompressed image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3218 * @param quality The quality of the JPEG encoding, between 1 (worst |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3219 * quality, best compression) and 100 (best quality, worst |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3220 * compression). |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3221 * @return 0 if success, or the error code if failure. |
1613
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3222 * @ingroup Images |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3223 **/ |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3224 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCompressJpegImage( |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3225 OrthancPluginContext* context, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3226 OrthancPluginMemoryBuffer* target, |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3227 OrthancPluginPixelFormat format, |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3228 uint32_t width, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3229 uint32_t height, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3230 uint32_t pitch, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3231 const void* buffer, |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3232 uint8_t quality) |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3233 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3234 _OrthancPluginCompressImage params; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3235 memset(¶ms, 0, sizeof(params)); |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3236 params.target = target; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3237 params.imageFormat = OrthancPluginImageFormat_Jpeg; |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3238 params.pixelFormat = format; |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3239 params.width = width; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3240 params.height = height; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3241 params.pitch = pitch; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3242 params.buffer = buffer; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3243 params.quality = quality; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3244 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3245 return context->InvokeService(context, _OrthancPluginService_CompressImage, ¶ms); |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3246 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3247 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3248 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3249 |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3250 /** |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3251 * @brief Answer to a REST request with a JPEG image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3252 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3253 * This function answers to a REST request with a JPEG image. The |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3254 * parameters of this function describe a memory buffer that |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3255 * contains an uncompressed image. The image will be automatically compressed |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3256 * as a JPEG image by the core system of Orthanc. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3257 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3258 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3259 * @param output The HTTP connection to the client application. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3260 * @param format The memory layout of the uncompressed image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3261 * @param width The width of the image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3262 * @param height The height of the image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3263 * @param pitch The pitch of the image (i.e. the number of bytes |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3264 * between 2 successive lines of the image in the memory buffer). |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3265 * @param buffer The memory buffer containing the uncompressed image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3266 * @param quality The quality of the JPEG encoding, between 1 (worst |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3267 * quality, best compression) and 100 (best quality, worst |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3268 * compression). |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
3269 * @ingroup REST |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3270 **/ |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3271 ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerJpegImage( |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3272 OrthancPluginContext* context, |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3273 OrthancPluginRestOutput* output, |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3274 OrthancPluginPixelFormat format, |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3275 uint32_t width, |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3276 uint32_t height, |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3277 uint32_t pitch, |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3278 const void* buffer, |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3279 uint8_t quality) |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3280 { |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3281 _OrthancPluginCompressAndAnswerImage params; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3282 params.output = output; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3283 params.imageFormat = OrthancPluginImageFormat_Jpeg; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3284 params.pixelFormat = format; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3285 params.width = width; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3286 params.height = height; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3287 params.pitch = pitch; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3288 params.buffer = buffer; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3289 params.quality = quality; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3290 context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, ¶ms); |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3291 } |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3292 |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3293 |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3294 |
1606
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3295 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3296 typedef struct |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3297 { |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3298 OrthancPluginMemoryBuffer* target; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3299 OrthancPluginHttpMethod method; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3300 const char* url; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3301 const char* username; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3302 const char* password; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3303 const char* body; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3304 uint32_t bodySize; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3305 } _OrthancPluginCallHttpClient; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3306 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3307 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3308 /** |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3309 * @brief Issue a HTTP GET call. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3310 * |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3311 * Make a HTTP GET call to the given URL. The result to the query is |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3312 * stored into a newly allocated memory buffer. Favor |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3313 * OrthancPluginRestApiGet() if calling the built-in REST API of the |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3314 * Orthanc instance that hosts this plugin. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3315 * |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3316 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3317 * @param target The target memory buffer. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3318 * @param url The URL of interest. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3319 * @param username The username (can be <tt>NULL</tt> if no password protection). |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3320 * @param password The password (can be <tt>NULL</tt> if no password protection). |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3321 * @return 0 if success, or the error code if failure. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3322 **/ |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3323 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpGet( |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3324 OrthancPluginContext* context, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3325 OrthancPluginMemoryBuffer* target, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3326 const char* url, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3327 const char* username, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3328 const char* password) |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3329 { |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3330 _OrthancPluginCallHttpClient params; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3331 memset(¶ms, 0, sizeof(params)); |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3332 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3333 params.target = target; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3334 params.method = OrthancPluginHttpMethod_Get; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3335 params.url = url; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3336 params.username = username; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3337 params.password = password; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3338 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3339 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, ¶ms); |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3340 } |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3341 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3342 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3343 /** |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3344 * @brief Issue a HTTP POST call. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3345 * |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3346 * Make a HTTP POST call to the given URL. The result to the query |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3347 * is stored into a newly allocated memory buffer. Favor |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3348 * OrthancPluginRestApiPost() if calling the built-in REST API of |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3349 * the Orthanc instance that hosts this plugin. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3350 * |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3351 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3352 * @param target The target memory buffer. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3353 * @param url The URL of interest. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3354 * @param body The content of the body of the request. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3355 * @param bodySize The size of the body of the request. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3356 * @param username The username (can be <tt>NULL</tt> if no password protection). |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3357 * @param password The password (can be <tt>NULL</tt> if no password protection). |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3358 * @return 0 if success, or the error code if failure. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3359 **/ |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3360 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpPost( |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3361 OrthancPluginContext* context, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3362 OrthancPluginMemoryBuffer* target, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3363 const char* url, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3364 const char* body, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3365 uint32_t bodySize, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3366 const char* username, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3367 const char* password) |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3368 { |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3369 _OrthancPluginCallHttpClient params; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3370 memset(¶ms, 0, sizeof(params)); |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3371 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3372 params.target = target; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3373 params.method = OrthancPluginHttpMethod_Post; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3374 params.url = url; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3375 params.body = body; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3376 params.bodySize = bodySize; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3377 params.username = username; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3378 params.password = password; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3379 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3380 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, ¶ms); |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3381 } |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3382 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3383 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3384 /** |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3385 * @brief Issue a HTTP PUT call. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3386 * |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3387 * Make a HTTP PUT call to the given URL. The result to the query is |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3388 * stored into a newly allocated memory buffer. Favor |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3389 * OrthancPluginRestApiPut() if calling the built-in REST API of the |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3390 * Orthanc instance that hosts this plugin. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3391 * |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3392 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3393 * @param target The target memory buffer. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3394 * @param url The URL of interest. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3395 * @param body The content of the body of the request. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3396 * @param bodySize The size of the body of the request. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3397 * @param username The username (can be <tt>NULL</tt> if no password protection). |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3398 * @param password The password (can be <tt>NULL</tt> if no password protection). |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3399 * @return 0 if success, or the error code if failure. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3400 **/ |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3401 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpPut( |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3402 OrthancPluginContext* context, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3403 OrthancPluginMemoryBuffer* target, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3404 const char* url, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3405 const char* body, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3406 uint32_t bodySize, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3407 const char* username, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3408 const char* password) |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3409 { |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3410 _OrthancPluginCallHttpClient params; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3411 memset(¶ms, 0, sizeof(params)); |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3412 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3413 params.target = target; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3414 params.method = OrthancPluginHttpMethod_Put; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3415 params.url = url; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3416 params.body = body; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3417 params.bodySize = bodySize; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3418 params.username = username; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3419 params.password = password; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3420 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3421 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, ¶ms); |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3422 } |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3423 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3424 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3425 /** |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3426 * @brief Issue a HTTP DELETE call. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3427 * |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3428 * Make a HTTP DELETE call to the given URL. Favor |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3429 * OrthancPluginRestApiDelete() if calling the built-in REST API of |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3430 * the Orthanc instance that hosts this plugin. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3431 * |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3432 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3433 * @param url The URL of interest. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3434 * @param username The username (can be <tt>NULL</tt> if no password protection). |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3435 * @param password The password (can be <tt>NULL</tt> if no password protection). |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3436 * @return 0 if success, or the error code if failure. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3437 **/ |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3438 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpDelete( |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3439 OrthancPluginContext* context, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3440 const char* url, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3441 const char* username, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3442 const char* password) |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3443 { |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3444 _OrthancPluginCallHttpClient params; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3445 memset(¶ms, 0, sizeof(params)); |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3446 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3447 params.method = OrthancPluginHttpMethod_Delete; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3448 params.url = url; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3449 params.username = username; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3450 params.password = password; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3451 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3452 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, ¶ms); |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3453 } |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3454 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3455 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3456 |
1608
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3457 typedef struct |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3458 { |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3459 OrthancPluginImage** target; |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3460 const OrthancPluginImage* source; |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3461 OrthancPluginPixelFormat targetFormat; |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3462 } _OrthancPluginConvertPixelFormat; |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3463 |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3464 |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3465 /** |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3466 * @brief Change the pixel format of an image. |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3467 * |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3468 * This function creates a new image, changing the memory layout of the pixels. |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3469 * |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3470 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3471 * @param source The source image. |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3472 * @param targetFormat The target pixel format. |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3473 * @return The resulting image. It must be freed with OrthancPluginFreeImage(). |
1613
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3474 * @ingroup Images |
1608
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3475 **/ |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3476 ORTHANC_PLUGIN_INLINE OrthancPluginImage *OrthancPluginConvertPixelFormat( |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3477 OrthancPluginContext* context, |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3478 const OrthancPluginImage* source, |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3479 OrthancPluginPixelFormat targetFormat) |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3480 { |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3481 OrthancPluginImage* target = NULL; |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3482 |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3483 _OrthancPluginConvertPixelFormat params; |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3484 params.target = ⌖ |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3485 params.source = source; |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3486 params.targetFormat = targetFormat; |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3487 |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3488 if (context->InvokeService(context, _OrthancPluginService_ConvertPixelFormat, ¶ms) != OrthancPluginErrorCode_Success) |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3489 { |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3490 return NULL; |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3491 } |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3492 else |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3493 { |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3494 return target; |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3495 } |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3496 } |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3497 |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3498 |
1613
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3499 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3500 /** |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3501 * @brief Return the number of available fonts. |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3502 * |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3503 * This function returns the number of fonts that are built in the |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3504 * Orthanc core. These fonts can be used to draw texts on images |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3505 * through OrthancPluginDrawText(). |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3506 * |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3507 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3508 * @return The number of fonts. |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3509 * @ingroup Images |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3510 **/ |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3511 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontsCount( |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3512 OrthancPluginContext* context) |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3513 { |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3514 uint32_t count = 0; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3515 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3516 _OrthancPluginReturnSingleValue params; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3517 memset(¶ms, 0, sizeof(params)); |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3518 params.resultUint32 = &count; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3519 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3520 if (context->InvokeService(context, _OrthancPluginService_GetFontsCount, ¶ms) != OrthancPluginErrorCode_Success) |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3521 { |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3522 /* Error */ |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3523 return 0; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3524 } |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3525 else |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3526 { |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3527 return count; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3528 } |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3529 } |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3530 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3531 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3532 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3533 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3534 typedef struct |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3535 { |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3536 uint32_t fontIndex; /* in */ |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3537 const char** name; /* out */ |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3538 uint32_t* size; /* out */ |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3539 } _OrthancPluginGetFontInfo; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3540 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3541 /** |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3542 * @brief Return the name of a font. |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3543 * |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3544 * This function returns the name of a font that is built in the Orthanc core. |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3545 * |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3546 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3547 * @param fontIndex The index of the font. This value must be less than OrthancPluginGetFontsCount(). |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3548 * @return The font name. This is a statically-allocated string, do not free it. |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3549 * @ingroup Images |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3550 **/ |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3551 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetFontName( |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3552 OrthancPluginContext* context, |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3553 uint32_t fontIndex) |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3554 { |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3555 const char* result = NULL; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3556 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3557 _OrthancPluginGetFontInfo params; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3558 memset(¶ms, 0, sizeof(params)); |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3559 params.name = &result; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3560 params.fontIndex = fontIndex; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3561 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3562 if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, ¶ms) != OrthancPluginErrorCode_Success) |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3563 { |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3564 return NULL; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3565 } |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3566 else |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3567 { |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3568 return result; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3569 } |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3570 } |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3571 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3572 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3573 /** |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3574 * @brief Return the size of a font. |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3575 * |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3576 * This function returns the size of a font that is built in the Orthanc core. |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3577 * |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3578 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3579 * @param fontIndex The index of the font. This value must be less than OrthancPluginGetFontsCount(). |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3580 * @return The font size. |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3581 * @ingroup Images |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3582 **/ |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3583 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontSize( |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3584 OrthancPluginContext* context, |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3585 uint32_t fontIndex) |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3586 { |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3587 uint32_t result; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3588 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3589 _OrthancPluginGetFontInfo params; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3590 memset(¶ms, 0, sizeof(params)); |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3591 params.size = &result; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3592 params.fontIndex = fontIndex; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3593 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3594 if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, ¶ms) != OrthancPluginErrorCode_Success) |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3595 { |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3596 return 0; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3597 } |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3598 else |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3599 { |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3600 return result; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3601 } |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3602 } |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3603 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3604 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3605 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3606 typedef struct |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3607 { |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3608 OrthancPluginImage* image; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3609 uint32_t fontIndex; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3610 const char* utf8Text; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3611 int32_t x; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3612 int32_t y; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3613 uint8_t r; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3614 uint8_t g; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3615 uint8_t b; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3616 } _OrthancPluginDrawText; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3617 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3618 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3619 /** |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3620 * @brief Draw text on an image. |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3621 * |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3622 * This function draws some text on some image. |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3623 * |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3624 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3625 * @param image The image upon which to draw the text. |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3626 * @param fontIndex The index of the font. This value must be less than OrthancPluginGetFontsCount(). |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3627 * @param utf8Text The text to be drawn, encoded as an UTF-8 zero-terminated string. |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3628 * @param x The X position of the text over the image. |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3629 * @param y The Y position of the text over the image. |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3630 * @param r The value of the red color channel of the text. |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3631 * @param g The value of the green color channel of the text. |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3632 * @param b The value of the blue color channel of the text. |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3633 * @return 0 if success, other value if error. |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3634 * @ingroup Images |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3635 **/ |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3636 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginDrawText( |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3637 OrthancPluginContext* context, |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3638 OrthancPluginImage* image, |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3639 uint32_t fontIndex, |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3640 const char* utf8Text, |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3641 int32_t x, |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3642 int32_t y, |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3643 uint8_t r, |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3644 uint8_t g, |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3645 uint8_t b) |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3646 { |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3647 _OrthancPluginDrawText params; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3648 memset(¶ms, 0, sizeof(params)); |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3649 params.image = image; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3650 params.fontIndex = fontIndex; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3651 params.utf8Text = utf8Text; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3652 params.x = x; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3653 params.y = y; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3654 params.r = r; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3655 params.g = g; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3656 params.b = b; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3657 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3658 return context->InvokeService(context, _OrthancPluginService_DrawText, ¶ms); |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3659 } |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3660 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3661 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3662 |
1615
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3663 typedef struct |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3664 { |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3665 OrthancPluginStorageArea* storageArea; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3666 const char* uuid; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3667 const void* content; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3668 uint64_t size; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3669 OrthancPluginContentType type; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3670 } _OrthancPluginStorageAreaCreate; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3671 |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3672 |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3673 /** |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3674 * @brief Create a file inside the storage area. |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3675 * |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3676 * This function creates a new file inside the storage area that is |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3677 * currently used by Orthanc. |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3678 * |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3679 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3680 * @param storageArea The storage area. |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3681 * @param uuid The identifier of the file to be created. |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3682 * @param content The content to store in the newly created file. |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3683 * @param size The size of the content. |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3684 * @param type The type of the file content. |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3685 * @return 0 if success, other value if error. |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3686 * @ingroup Callbacks |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3687 **/ |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3688 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaCreate( |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3689 OrthancPluginContext* context, |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3690 OrthancPluginStorageArea* storageArea, |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3691 const char* uuid, |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3692 const void* content, |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3693 uint64_t size, |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3694 OrthancPluginContentType type) |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3695 { |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3696 _OrthancPluginStorageAreaCreate params; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3697 params.storageArea = storageArea; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3698 params.uuid = uuid; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3699 params.content = content; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3700 params.size = size; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3701 params.type = type; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3702 |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3703 return context->InvokeService(context, _OrthancPluginService_StorageAreaCreate, ¶ms); |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3704 } |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3705 |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3706 |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3707 typedef struct |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3708 { |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3709 OrthancPluginMemoryBuffer* target; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3710 OrthancPluginStorageArea* storageArea; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3711 const char* uuid; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3712 OrthancPluginContentType type; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3713 } _OrthancPluginStorageAreaRead; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3714 |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3715 |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3716 /** |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3717 * @brief Read a file from the storage area. |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3718 * |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3719 * This function reads the content of a given file from the storage |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3720 * area that is currently used by Orthanc. |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3721 * |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3722 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3723 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer(). |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3724 * @param storageArea The storage area. |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3725 * @param uuid The identifier of the file to be read. |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3726 * @param type The type of the file content. |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3727 * @return 0 if success, other value if error. |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3728 * @ingroup Callbacks |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3729 **/ |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3730 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaRead( |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3731 OrthancPluginContext* context, |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3732 OrthancPluginMemoryBuffer* target, |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3733 OrthancPluginStorageArea* storageArea, |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3734 const char* uuid, |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3735 OrthancPluginContentType type) |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3736 { |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3737 _OrthancPluginStorageAreaRead params; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3738 params.target = target; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3739 params.storageArea = storageArea; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3740 params.uuid = uuid; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3741 params.type = type; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3742 |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3743 return context->InvokeService(context, _OrthancPluginService_StorageAreaRead, ¶ms); |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3744 } |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3745 |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3746 |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3747 typedef struct |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3748 { |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3749 OrthancPluginStorageArea* storageArea; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3750 const char* uuid; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3751 OrthancPluginContentType type; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3752 } _OrthancPluginStorageAreaRemove; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3753 |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3754 /** |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3755 * @brief Remove a file from the storage area. |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3756 * |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3757 * This function removes a given file from the storage area that is |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3758 * currently used by Orthanc. |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3759 * |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3760 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3761 * @param storageArea The storage area. |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3762 * @param uuid The identifier of the file to be removed. |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3763 * @param type The type of the file content. |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3764 * @return 0 if success, other value if error. |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3765 * @ingroup Callbacks |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3766 **/ |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3767 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaRemove( |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3768 OrthancPluginContext* context, |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3769 OrthancPluginStorageArea* storageArea, |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3770 const char* uuid, |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3771 OrthancPluginContentType type) |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3772 { |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3773 _OrthancPluginStorageAreaRemove params; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3774 params.storageArea = storageArea; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3775 params.uuid = uuid; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3776 params.type = type; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3777 |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3778 return context->InvokeService(context, _OrthancPluginService_StorageAreaRemove, ¶ms); |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3779 } |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3780 |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3781 |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3782 |
1649
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3783 typedef struct |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3784 { |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3785 OrthancPluginErrorCode* target; |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3786 int32_t code; |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3787 uint16_t httpStatus; |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3788 const char* message; |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3789 } _OrthancPluginRegisterErrorCode; |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3790 |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3791 /** |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3792 * @brief Declare a custom error code for this plugin. |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3793 * |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3794 * This function declares a custom error code that can be generated |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3795 * by this plugin. This declaration is used to enrich the body of |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3796 * the HTTP answer in the case of an error, and to set the proper |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3797 * HTTP status code. |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3798 * |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3799 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3800 * @param code The error code that is internal to this plugin. |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3801 * @param httpStatus The HTTP status corresponding to this error. |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3802 * @param message The description of the error. |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3803 * @return The error code that has been assigned inside the Orthanc core. |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3804 * @ingroup Toolbox |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3805 **/ |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3806 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterErrorCode( |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3807 OrthancPluginContext* context, |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3808 int32_t code, |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3809 uint16_t httpStatus, |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3810 const char* message) |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3811 { |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3812 OrthancPluginErrorCode target; |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3813 |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3814 _OrthancPluginRegisterErrorCode params; |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3815 params.target = ⌖ |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3816 params.code = code; |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3817 params.httpStatus = httpStatus; |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3818 params.message = message; |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3819 |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3820 if (context->InvokeService(context, _OrthancPluginService_RegisterErrorCode, ¶ms) == OrthancPluginErrorCode_Success) |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3821 { |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3822 return target; |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3823 } |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3824 else |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3825 { |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3826 /* There was an error while assigned the error. Use a generic code. */ |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3827 return OrthancPluginErrorCode_Plugin; |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3828 } |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3829 } |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3830 |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3831 |
1657
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3832 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3833 typedef struct |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3834 { |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3835 uint16_t group; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3836 uint16_t element; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3837 OrthancPluginValueRepresentation vr; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3838 const char* name; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3839 uint32_t minMultiplicity; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3840 uint32_t maxMultiplicity; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3841 } _OrthancPluginRegisterDictionaryTag; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3842 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3843 /** |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3844 * @brief Register a new tag into the DICOM dictionary. |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3845 * |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3846 * This function declares a new tag in the dictionary of DICOM tags |
1765
57b9e6890482
New configuration option: "Dictionary" to declare custom DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1760
diff
changeset
|
3847 * that are known to Orthanc. This function should be used in the |
1657
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3848 * OrthancPluginInitialize() callback. |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3849 * |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3850 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3851 * @param group The group of the tag. |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3852 * @param element The element of the tag. |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3853 * @param vr The value representation of the tag. |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3854 * @param name The nickname of the tag. |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3855 * @param minMultiplicity The minimum multiplicity of the tag (must be above 0). |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3856 * @param maxMultiplicity The maximum multiplicity of the tag. A value of 0 means |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3857 * an arbitrary multiplicity ("<tt>n</tt>"). |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3858 * @return 0 if success, other value if error. |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3859 * @ingroup Toolbox |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3860 **/ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3861 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterDictionaryTag( |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3862 OrthancPluginContext* context, |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3863 uint16_t group, |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3864 uint16_t element, |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3865 OrthancPluginValueRepresentation vr, |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3866 const char* name, |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3867 uint32_t minMultiplicity, |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3868 uint32_t maxMultiplicity) |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3869 { |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3870 _OrthancPluginRegisterDictionaryTag params; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3871 params.group = group; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3872 params.element = element; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3873 params.vr = vr; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3874 params.name = name; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3875 params.minMultiplicity = minMultiplicity; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3876 params.maxMultiplicity = maxMultiplicity; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3877 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3878 return context->InvokeService(context, _OrthancPluginService_RegisterDictionaryTag, ¶ms); |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3879 } |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3880 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3881 |
1669
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3882 |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3883 |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3884 typedef struct |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3885 { |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3886 OrthancPluginStorageArea* storageArea; |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3887 OrthancPluginResourceType level; |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3888 } _OrthancPluginReconstructMainDicomTags; |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3889 |
1673
0bbcfd9695e5
UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1669
diff
changeset
|
3890 /** |
0bbcfd9695e5
UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1669
diff
changeset
|
3891 * @brief Reconstruct the main DICOM tags. |
0bbcfd9695e5
UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1669
diff
changeset
|
3892 * |
0bbcfd9695e5
UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1669
diff
changeset
|
3893 * This function requests the Orthanc core to reconstruct the main |
0bbcfd9695e5
UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1669
diff
changeset
|
3894 * DICOM tags of all the resources of the given type. This function |
0bbcfd9695e5
UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1669
diff
changeset
|
3895 * can only be used as a part of the upgrade of a custom database |
0bbcfd9695e5
UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1669
diff
changeset
|
3896 * back-end |
0bbcfd9695e5
UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1669
diff
changeset
|
3897 * (cf. OrthancPlugins::IDatabaseBackend::UpgradeDatabase). A |
0bbcfd9695e5
UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1669
diff
changeset
|
3898 * database transaction will be automatically setup. |
0bbcfd9695e5
UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1669
diff
changeset
|
3899 * |
0bbcfd9695e5
UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1669
diff
changeset
|
3900 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
0bbcfd9695e5
UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1669
diff
changeset
|
3901 * @param storageArea The storage area. |
0bbcfd9695e5
UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1669
diff
changeset
|
3902 * @param level The type of the resources of interest. |
0bbcfd9695e5
UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1669
diff
changeset
|
3903 * @return 0 if success, other value if error. |
0bbcfd9695e5
UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1669
diff
changeset
|
3904 * @ingroup Callbacks |
0bbcfd9695e5
UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1669
diff
changeset
|
3905 **/ |
1669
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3906 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginReconstructMainDicomTags( |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3907 OrthancPluginContext* context, |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3908 OrthancPluginStorageArea* storageArea, |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3909 OrthancPluginResourceType level) |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3910 { |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3911 _OrthancPluginReconstructMainDicomTags params; |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3912 params.level = level; |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3913 params.storageArea = storageArea; |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3914 |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3915 return context->InvokeService(context, _OrthancPluginService_ReconstructMainDicomTags, ¶ms); |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3916 } |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3917 |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3918 |
1740
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3919 typedef struct |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3920 { |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3921 char** result; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3922 const char* instanceId; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3923 const char* buffer; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3924 uint32_t size; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3925 OrthancPluginDicomToJsonFormat format; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3926 OrthancPluginDicomToJsonFlags flags; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3927 uint32_t maxStringLength; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3928 } _OrthancPluginDicomToJson; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3929 |
1743 | 3930 |
3931 /** | |
3932 * @brief Format a DICOM memory buffer as a JSON string. | |
3933 * | |
3934 * This function takes as input a memory buffer containing a DICOM | |
3935 * file, and outputs a JSON string representing the tags of this | |
3936 * DICOM file. | |
3937 * | |
3938 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
3939 * @param buffer The memory buffer containing the DICOM file. | |
3940 * @param size The size of the memory buffer. | |
3941 * @param format The output format. | |
3942 * @param flags The output flags. | |
3943 * @param maxStringLength The maximum length of a field. Too long fields will | |
3944 * be output as "null". The 0 value means no maximum length. | |
3945 * @return The NULL value if the case of an error, or the JSON | |
3946 * string. This string must be freed by OrthancPluginFreeString(). | |
3947 * @ingroup Toolbox | |
3948 * @see OrthancPluginDicomInstanceToJson | |
3949 **/ | |
1740
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3950 ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomBufferToJson( |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3951 OrthancPluginContext* context, |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3952 const char* buffer, |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3953 uint32_t size, |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3954 OrthancPluginDicomToJsonFormat format, |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3955 OrthancPluginDicomToJsonFlags flags, |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3956 uint32_t maxStringLength) |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3957 { |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3958 char* result; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3959 |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3960 _OrthancPluginDicomToJson params; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3961 memset(¶ms, 0, sizeof(params)); |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3962 params.result = &result; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3963 params.buffer = buffer; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3964 params.size = size; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3965 params.format = format; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3966 params.flags = flags; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3967 params.maxStringLength = maxStringLength; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3968 |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3969 if (context->InvokeService(context, _OrthancPluginService_DicomBufferToJson, ¶ms) != OrthancPluginErrorCode_Success) |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3970 { |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3971 /* Error */ |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3972 return NULL; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3973 } |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3974 else |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3975 { |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3976 return result; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3977 } |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3978 } |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3979 |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3980 |
1743 | 3981 /** |
3982 * @brief Format a DICOM instance as a JSON string. | |
3983 * | |
3984 * This function formats a DICOM instance that is stored in Orthanc, | |
3985 * and outputs a JSON string representing the tags of this DICOM | |
3986 * instance. | |
3987 * | |
3988 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
3989 * @param instanceId The Orthanc identifier of the instance. | |
3990 * @param format The output format. | |
3991 * @param flags The output flags. | |
3992 * @param maxStringLength The maximum length of a field. Too long fields will | |
3993 * be output as "null". The 0 value means no maximum length. | |
3994 * @return The NULL value if the case of an error, or the JSON | |
3995 * string. This string must be freed by OrthancPluginFreeString(). | |
3996 * @ingroup Toolbox | |
3997 * @see OrthancPluginDicomInstanceToJson | |
3998 **/ | |
1740
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3999 ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomInstanceToJson( |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
4000 OrthancPluginContext* context, |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
4001 const char* instanceId, |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
4002 OrthancPluginDicomToJsonFormat format, |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
4003 OrthancPluginDicomToJsonFlags flags, |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
4004 uint32_t maxStringLength) |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
4005 { |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
4006 char* result; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
4007 |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
4008 _OrthancPluginDicomToJson params; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
4009 memset(¶ms, 0, sizeof(params)); |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
4010 params.result = &result; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
4011 params.instanceId = instanceId; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
4012 params.format = format; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
4013 params.flags = flags; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
4014 params.maxStringLength = maxStringLength; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
4015 |
1741
06addfcd1d4c
OrthancStarted and OrthancStopped events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1740
diff
changeset
|
4016 if (context->InvokeService(context, _OrthancPluginService_DicomInstanceToJson, ¶ms) != OrthancPluginErrorCode_Success) |
1740
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
4017 { |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
4018 /* Error */ |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
4019 return NULL; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
4020 } |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
4021 else |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
4022 { |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
4023 return result; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
4024 } |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
4025 } |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
4026 |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
4027 |
1780
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4028 typedef struct |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4029 { |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4030 OrthancPluginMemoryBuffer* target; |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4031 const char* uri; |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4032 uint32_t headersCount; |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4033 const char* const* headersKeys; |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4034 const char* const* headersValues; |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4035 int32_t afterPlugins; |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4036 } _OrthancPluginRestApiGet2; |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4037 |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4038 /** |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4039 * @brief Make a GET call to the Orthanc REST API, with custom HTTP headers. |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4040 * |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4041 * Make a GET call to the Orthanc REST API with extended |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4042 * parameters. The result to the query is stored into a newly |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4043 * allocated memory buffer. |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4044 * |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4045 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4046 * @param target The target memory buffer. |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4047 * @param uri The URI in the built-in Orthanc API. |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4048 * @param headersCount The number of HTTP headers. |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4049 * @param headersKeys Array containing the keys of the HTTP headers. |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4050 * @param headersValues Array containing the values of the HTTP headers. |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4051 * @param afterPlugins If 0, the built-in API of Orthanc is used. |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4052 * If 1, the API is tainted by the plugins. |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4053 * @return 0 if success, or the error code if failure. |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4054 * @see OrthancPluginRestApiGet, OrthancPluginRestApiGetAfterPlugins |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4055 * @ingroup Orthanc |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4056 **/ |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4057 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGet2( |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4058 OrthancPluginContext* context, |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4059 OrthancPluginMemoryBuffer* target, |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4060 const char* uri, |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4061 uint32_t headersCount, |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4062 const char* const* headersKeys, |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4063 const char* const* headersValues, |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4064 int32_t afterPlugins) |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4065 { |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4066 _OrthancPluginRestApiGet2 params; |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4067 params.target = target; |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4068 params.uri = uri; |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4069 params.headersCount = headersCount; |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4070 params.headersKeys = headersKeys; |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4071 params.headersValues = headersValues; |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4072 params.afterPlugins = afterPlugins; |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4073 |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4074 return context->InvokeService(context, _OrthancPluginService_RestApiGet2, ¶ms); |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4075 } |
94990da8710e
OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1773
diff
changeset
|
4076 |
1800
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4077 |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4078 |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4079 typedef struct |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4080 { |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4081 OrthancPluginWorklistCallback callback; |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4082 } _OrthancPluginWorklistCallback; |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4083 |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4084 /** |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4085 * @brief Register a callback to handle modality worklists requests. |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4086 * |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4087 * This function registers a callback to handle C-Find SCP requests |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4088 * on modality worklists. |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4089 * |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4090 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4091 * @param callback The callback. |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4092 * @ingroup Worklists |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4093 **/ |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4094 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterWorklistCallback( |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4095 OrthancPluginContext* context, |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4096 OrthancPluginWorklistCallback callback) |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4097 { |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4098 _OrthancPluginWorklistCallback params; |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4099 params.callback = callback; |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4100 |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4101 context->InvokeService(context, _OrthancPluginService_RegisterWorklistCallback, ¶ms); |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4102 } |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4103 |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4104 |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4105 |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4106 typedef struct |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4107 { |
1802
138664eb59de
sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1801
diff
changeset
|
4108 OrthancPluginWorklistAnswers* answers; |
138664eb59de
sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1801
diff
changeset
|
4109 const OrthancPluginWorklistQuery* query; |
138664eb59de
sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1801
diff
changeset
|
4110 const void* dicom; |
138664eb59de
sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1801
diff
changeset
|
4111 uint32_t size; |
1801
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4112 } _OrthancPluginWorklistAnswersOperation; |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4113 |
1803 | 4114 /** |
4115 * @brief Add one answer to some modality worklist request. | |
4116 * | |
4117 * This function adds one worklist (encoded as a DICOM file) to the | |
4118 * set of answers corresponding to some C-Find SCP request against | |
4119 * modality worklists. | |
4120 * | |
4121 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
4122 * @param answers The set of answers. | |
4123 * @param query The worklist query, as received by the callback. | |
4124 * @param dicom The worklist to answer, encoded as a DICOM file. | |
4125 * @param size The size of the DICOM file. | |
4126 * @return 0 if success, other value if error. | |
4127 * @ingroup Worklists | |
4128 **/ | |
1810
796d0b087fb8
more consistent naming in worklist primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1803
diff
changeset
|
4129 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistAddAnswer( |
1802
138664eb59de
sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1801
diff
changeset
|
4130 OrthancPluginContext* context, |
138664eb59de
sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1801
diff
changeset
|
4131 OrthancPluginWorklistAnswers* answers, |
138664eb59de
sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1801
diff
changeset
|
4132 const OrthancPluginWorklistQuery* query, |
138664eb59de
sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1801
diff
changeset
|
4133 const void* dicom, |
138664eb59de
sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1801
diff
changeset
|
4134 uint32_t size) |
1800
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4135 { |
1801
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4136 _OrthancPluginWorklistAnswersOperation params; |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4137 params.answers = answers; |
1802
138664eb59de
sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1801
diff
changeset
|
4138 params.query = query; |
1801
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4139 params.dicom = dicom; |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4140 params.size = size; |
1800
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4141 |
1810
796d0b087fb8
more consistent naming in worklist primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1803
diff
changeset
|
4142 return context->InvokeService(context, _OrthancPluginService_WorklistAddAnswer, ¶ms); |
1800
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4143 } |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4144 |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
4145 |
1803 | 4146 /** |
4147 * @brief Mark the set of worklist answers as incomplete. | |
4148 * | |
4149 * This function marks as incomplete the set of answers | |
4150 * corresponding to some C-Find SCP request against modality | |
4151 * worklists. This must be used if canceling the handling of a | |
4152 * request when too many answers are to be returned. | |
4153 * | |
4154 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
4155 * @param answers The set of answers. | |
4156 * @return 0 if success, other value if error. | |
4157 * @ingroup Worklists | |
4158 **/ | |
1810
796d0b087fb8
more consistent naming in worklist primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1803
diff
changeset
|
4159 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistMarkIncomplete( |
1801
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4160 OrthancPluginContext* context, |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4161 OrthancPluginWorklistAnswers* answers) |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4162 { |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4163 _OrthancPluginWorklistAnswersOperation params; |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4164 params.answers = answers; |
1802
138664eb59de
sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1801
diff
changeset
|
4165 params.query = NULL; |
1801
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4166 params.dicom = NULL; |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4167 params.size = 0; |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4168 |
1810
796d0b087fb8
more consistent naming in worklist primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1803
diff
changeset
|
4169 return context->InvokeService(context, _OrthancPluginService_WorklistMarkIncomplete, ¶ms); |
1801
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4170 } |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4171 |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4172 |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4173 typedef struct |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4174 { |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4175 const OrthancPluginWorklistQuery* query; |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4176 const void* dicom; |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4177 uint32_t size; |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4178 int32_t* isMatch; |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4179 OrthancPluginMemoryBuffer* target; |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4180 } _OrthancPluginWorklistQueryOperation; |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4181 |
1803 | 4182 /** |
4183 * @brief Test whether a worklist matches the query. | |
4184 * | |
4185 * This function checks whether one worklist (encoded as a DICOM | |
4186 * file) matches the C-Find SCP query against modality | |
4187 * worklists. This function must be called before adding the | |
1810
796d0b087fb8
more consistent naming in worklist primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1803
diff
changeset
|
4188 * worklist as an answer through OrthancPluginWorklistAddAnswer(). |
1803 | 4189 * |
4190 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
4191 * @param query The worklist query, as received by the callback. | |
4192 * @param dicom The worklist to answer, encoded as a DICOM file. | |
4193 * @param size The size of the DICOM file. | |
4194 * @return 1 if the worklist matches the query, 0 otherwise. | |
4195 * @ingroup Worklists | |
4196 **/ | |
1810
796d0b087fb8
more consistent naming in worklist primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1803
diff
changeset
|
4197 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginWorklistIsMatch( |
1801
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4198 OrthancPluginContext* context, |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4199 const OrthancPluginWorklistQuery* query, |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4200 const void* dicom, |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4201 uint32_t size) |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4202 { |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4203 int32_t isMatch = 0; |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4204 |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4205 _OrthancPluginWorklistQueryOperation params; |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4206 params.query = query; |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4207 params.dicom = dicom; |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4208 params.size = size; |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4209 params.isMatch = &isMatch; |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4210 params.target = NULL; |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4211 |
1810
796d0b087fb8
more consistent naming in worklist primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1803
diff
changeset
|
4212 if (context->InvokeService(context, _OrthancPluginService_WorklistIsMatch, ¶ms) == OrthancPluginErrorCode_Success) |
1801
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4213 { |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4214 return isMatch; |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4215 } |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4216 else |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4217 { |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4218 /* Error: Assume non-match */ |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4219 return 0; |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4220 } |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4221 } |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4222 |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4223 |
1803 | 4224 /** |
4225 * @brief Retrieve the worklist query as a DICOM file. | |
4226 * | |
4227 * This function retrieves the DICOM file that underlies a C-Find | |
4228 * SCP query against modality worklists. | |
4229 * | |
4230 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
4231 * @param target Memory buffer where to store the DICOM file. It must be freed with OrthancPluginFreeMemoryBuffer(). | |
4232 * @param query The worklist query, as received by the callback. | |
4233 * @return 0 if success, other value if error. | |
4234 * @ingroup Worklists | |
4235 **/ | |
1810
796d0b087fb8
more consistent naming in worklist primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1803
diff
changeset
|
4236 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistGetDicomQuery( |
1801
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4237 OrthancPluginContext* context, |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4238 OrthancPluginMemoryBuffer* target, |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4239 const OrthancPluginWorklistQuery* query) |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4240 { |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4241 _OrthancPluginWorklistQueryOperation params; |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4242 params.query = query; |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4243 params.dicom = NULL; |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4244 params.size = 0; |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4245 params.isMatch = NULL; |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4246 params.target = target; |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4247 |
1810
796d0b087fb8
more consistent naming in worklist primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1803
diff
changeset
|
4248 return context->InvokeService(context, _OrthancPluginService_WorklistGetDicomQuery, ¶ms); |
1801
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4249 } |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4250 |
2c60c357ee3e
sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
4251 |
886 | 4252 #ifdef __cplusplus |
4253 } | |
4254 #endif | |
900 | 4255 |
4256 | |
4257 /** @} */ | |
4258 |