Mercurial > hg > orthanc
annotate Plugins/Include/orthanc/OrthancCPlugin.h @ 1743:8fc1d096aa38
documentation
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 23 Oct 2015 17:04:22 +0200 |
parents | 06addfcd1d4c |
children | d143db00a794 |
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(). |
907 | 21 * -# <tt>void OrthancPluginFinalize()</tt>: |
22 * This function is invoked by Orthanc during its shutdown. The plugin | |
23 * must free all its memory. | |
24 * -# <tt>const char* OrthancPluginGetName()</tt>: | |
25 * 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
|
26 * -# <tt>const char* OrthancPluginGetVersion()</tt>: |
907 | 27 * The plugin must return a string containing its version number. |
28 * | |
29 * The name and the version of a plugin is only used to prevent it | |
1602 | 30 * from being loaded twice. Note that, in C++, it is mandatory to |
31 * declare these functions within an <tt>extern "C"</tt> section. | |
907 | 32 * |
1595
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
33 * To ensure multi-threading safety, the various REST callbacks are |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
34 * guaranteed to be executed in mutual exclusion since Orthanc |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
35 * 0.8.5. If this feature is undesired (notably when developing |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
36 * high-performance plugins handling simultaneous requests), use |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
37 * ::OrthancPluginRegisterRestCallbackNoLock(). |
906
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
38 **/ |
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 |
900 | 42 /** |
1613
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
43 * @defgroup Images Images and compression |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
44 * @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
|
45 * |
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
46 * @defgroup REST REST |
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
47 * @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
|
48 * |
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
49 * @defgroup Callbacks Callbacks |
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
50 * @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
|
51 * |
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
52 * @defgroup Orthanc Orthanc |
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
53 * @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
|
54 **/ |
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
55 |
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
56 |
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
57 |
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 * @defgroup Toolbox Toolbox |
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
60 * @brief Generic functions to help with the creation of plugins. |
900 | 61 **/ |
62 | |
63 | |
906
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
64 |
886 | 65 /** |
66 * Orthanc - A Lightweight, RESTful DICOM Store | |
1288
6e7e5ed91c2d
upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1282
diff
changeset
|
67 * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics |
6e7e5ed91c2d
upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1282
diff
changeset
|
68 * Department, University Hospital of Liege, Belgium |
886 | 69 * |
70 * This program is free software: you can redistribute it and/or | |
71 * modify it under the terms of the GNU General Public License as | |
72 * published by the Free Software Foundation, either version 3 of the | |
73 * License, or (at your option) any later version. | |
74 * | |
75 * In addition, as a special exception, the copyright holders of this | |
76 * program give permission to link the code of its release with the | |
77 * OpenSSL project's "OpenSSL" library (or with modified versions of it | |
78 * that use the same license as the "OpenSSL" library), and distribute | |
79 * the linked executables. You must obey the GNU General Public License | |
80 * in all respects for all of the code used other than "OpenSSL". If you | |
81 * modify file(s) with this exception, you may extend this exception to | |
82 * your version of the file(s), but you are not obligated to do so. If | |
83 * you do not wish to do so, delete this exception statement from your | |
84 * version. If you delete this exception statement from all source files | |
85 * in the program, then also delete it here. | |
86 * | |
87 * This program is distributed in the hope that it will be useful, but | |
88 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
89 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
90 * General Public License for more details. | |
91 * | |
92 * You should have received a copy of the GNU General Public License | |
93 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
94 **/ | |
95 | |
96 | |
906
cbc0ea03dffe
sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
904
diff
changeset
|
97 |
886 | 98 #pragma once |
99 | |
100 | |
900 | 101 #include <stdio.h> |
102 #include <string.h> | |
103 | |
886 | 104 #ifdef WIN32 |
105 #define ORTHANC_PLUGINS_API __declspec(dllexport) | |
106 #else | |
107 #define ORTHANC_PLUGINS_API | |
108 #endif | |
109 | |
1039
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
110 #define ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER 0 |
1407
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
111 #define ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER 9 |
1629
bad4772b605c
OrthancPluginErrorCode in database plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1628
diff
changeset
|
112 #define ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER 5 |
1039
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
113 |
886 | 114 |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
115 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
116 /******************************************************************** |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
117 ** Check that function inlining is properly supported. The use of |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
118 ** inlining is required, to avoid the duplication of object code |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
119 ** between two compilation modules that would use the Orthanc Plugin |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
120 ** API. |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
121 ********************************************************************/ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
122 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
123 /* 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
|
124 automatically and that your compiler is known to properly support |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
125 inlining, uncomment the following #define and adapt the definition |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
126 of "static inline". */ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
127 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
128 /* #define ORTHANC_PLUGIN_INLINE static inline */ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
129 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
130 #ifndef ORTHANC_PLUGIN_INLINE |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
131 # if __STDC_VERSION__ >= 199901L |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
132 /* 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
|
133 # define ORTHANC_PLUGIN_INLINE static inline |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
134 # elif defined(__cplusplus) |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
135 /* This is C++ */ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
136 # define ORTHANC_PLUGIN_INLINE static inline |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
137 # elif defined(__GNUC__) |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
138 /* This is GCC running in C89 mode */ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
139 # define ORTHANC_PLUGIN_INLINE static __inline |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
140 # elif defined(_MSC_VER) |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
141 /* This is Visual Studio running in C89 mode */ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
142 # define ORTHANC_PLUGIN_INLINE static __inline |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
143 # else |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
144 # 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
|
145 # endif |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
146 #endif |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
147 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
148 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
149 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
150 /******************************************************************** |
907 | 151 ** Inclusion of standard libraries. |
898
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 |
1322
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1313
diff
changeset
|
154 /** |
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1313
diff
changeset
|
155 * 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
|
156 * downloaded at the following URL: |
f497a72d9f71
fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1313
diff
changeset
|
157 * 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
|
158 **/ |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
159 #include <stdint.h> |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
160 |
886 | 161 #include <stdlib.h> |
162 | |
163 | |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
164 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
165 /******************************************************************** |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
166 ** Definition of the Orthanc Plugin API. |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
167 ********************************************************************/ |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
168 |
900 | 169 /** @{ */ |
170 | |
886 | 171 #ifdef __cplusplus |
172 extern "C" | |
173 { | |
174 #endif | |
175 | |
907 | 176 /** |
1578 | 177 * The various error codes that can be returned by the Orthanc core. |
178 **/ | |
179 typedef enum | |
180 { | |
1579
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
181 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
|
182 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
|
183 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
|
184 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
|
185 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
|
186 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
|
187 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
|
188 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
|
189 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
|
190 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
|
191 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
|
192 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
|
193 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
|
194 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
|
195 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
|
196 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
|
197 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
|
198 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
|
199 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
|
200 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
|
201 OrthancPluginErrorCode_FullStorage = 19 /*!< The file storage is full */, |
1582
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
202 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
|
203 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
|
204 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
|
205 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
|
206 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
|
207 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
|
208 OrthancPluginErrorCode_UnknownPluginService = 26 /*!< Plugin invoking an unknown service */, |
1582
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
209 OrthancPluginErrorCode_UnknownDicomTag = 27 /*!< Unknown DICOM tag */, |
1596
f2e3d030ea59
BadJson error code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1595
diff
changeset
|
210 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
|
211 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
|
212 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
|
213 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
|
214 OrthancPluginErrorCode_StorageAreaPlugin = 32 /*!< Error in the plugin implementing a custom storage area */, |
1582
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
215 OrthancPluginErrorCode_SQLiteNotOpened = 1000 /*!< SQLite: The database is not opened */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
216 OrthancPluginErrorCode_SQLiteAlreadyOpened = 1001 /*!< SQLite: Connection is already open */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
217 OrthancPluginErrorCode_SQLiteCannotOpen = 1002 /*!< SQLite: Unable to open the database */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
218 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
|
219 OrthancPluginErrorCode_SQLiteExecute = 1004 /*!< SQLite: Cannot execute a command */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
220 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
|
221 OrthancPluginErrorCode_SQLiteCommitWithoutTransaction = 1006 /*!< SQLite: Committing a nonexistent transaction */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
222 OrthancPluginErrorCode_SQLiteRegisterFunction = 1007 /*!< SQLite: Unable to register a function */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
223 OrthancPluginErrorCode_SQLiteFlush = 1008 /*!< SQLite: Unable to flush the database */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
224 OrthancPluginErrorCode_SQLiteCannotRun = 1009 /*!< SQLite: Cannot run a cached statement */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
225 OrthancPluginErrorCode_SQLiteCannotStep = 1010 /*!< SQLite: Cannot step over a cached statement */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
226 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
|
227 OrthancPluginErrorCode_SQLitePrepareStatement = 1012 /*!< SQLite: Cannot prepare a cached statement */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
228 OrthancPluginErrorCode_SQLiteTransactionAlreadyStarted = 1013 /*!< SQLite: Beginning the same transaction twice */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
229 OrthancPluginErrorCode_SQLiteTransactionCommit = 1014 /*!< SQLite: Failure when committing the transaction */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
230 OrthancPluginErrorCode_SQLiteTransactionBegin = 1015 /*!< SQLite: Cannot start a transaction */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
231 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
|
232 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
|
233 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
|
234 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
|
235 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
|
236 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
|
237 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
|
238 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
|
239 OrthancPluginErrorCode_MakeDirectory = 2008 /*!< Cannot create a directory */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
240 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
|
241 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
|
242 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
|
243 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
|
244 OrthancPluginErrorCode_NoApplicationEntityFilter = 2013 /*!< No application entity filter */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
245 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
|
246 OrthancPluginErrorCode_NoPresentationContext = 2015 /*!< DicomUserConnection: No acceptable presentation context for modality */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
247 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
|
248 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
|
249 OrthancPluginErrorCode_CannotStoreInstance = 2018 /*!< Cannot store an instance */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
250 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
|
251 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
|
252 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
|
253 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
|
254 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
|
255 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
|
256 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
|
257 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
|
258 OrthancPluginErrorCode_UnknownModality = 2027 /*!< Unknown modality */, |
bd1889029cbb
encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1581
diff
changeset
|
259 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
|
260 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
|
261 OrthancPluginErrorCode_CannotCreateLua = 2030 /*!< Cannot create the Lua context */, |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
262 OrthancPluginErrorCode_CannotExecuteLua = 2031 /*!< Cannot execute a Lua command */, |
9ea3d082b064
got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1582
diff
changeset
|
263 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
|
264 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
|
265 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
|
266 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
|
267 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
|
268 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
|
269 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
|
270 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
|
271 OrthancPluginErrorCode_CannotOrderSlices = 2040 /*!< Unable to order the slices of the series */, |
1580
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
272 |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
273 _OrthancPluginErrorCode_INTERNAL = 0x7fffffff |
1578 | 274 } OrthancPluginErrorCode; |
275 | |
276 | |
277 /** | |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
278 * 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
|
279 * plugins. |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
280 **/ |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
281 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
|
282 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
283 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
284 /** |
907 | 285 * The various HTTP methods for a REST call. |
286 **/ | |
894 | 287 typedef enum |
288 { | |
907 | 289 OrthancPluginHttpMethod_Get = 1, /*!< GET request */ |
290 OrthancPluginHttpMethod_Post = 2, /*!< POST request */ | |
291 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
|
292 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
|
293 |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
294 _OrthancPluginHttpMethod_INTERNAL = 0x7fffffff |
896 | 295 } OrthancPluginHttpMethod; |
886 | 296 |
907 | 297 |
298 /** | |
299 * @brief The parameters of a REST request. | |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
300 * @ingroup Callbacks |
907 | 301 **/ |
899 | 302 typedef struct |
303 { | |
907 | 304 /** |
305 * @brief The HTTP method. | |
306 **/ | |
307 OrthancPluginHttpMethod method; | |
899 | 308 |
907 | 309 /** |
310 * @brief The number of groups of the regular expression. | |
311 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
312 uint32_t groupsCount; |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
313 |
907 | 314 /** |
315 * @brief The matched values for the groups of the regular expression. | |
316 **/ | |
317 const char* const* groups; | |
318 | |
319 /** | |
320 * @brief For a GET request, the number of GET parameters. | |
321 **/ | |
899 | 322 uint32_t getCount; |
323 | |
907 | 324 /** |
325 * @brief For a GET request, the keys of the GET parameters. | |
326 **/ | |
327 const char* const* getKeys; | |
328 | |
329 /** | |
330 * @brief For a GET request, the values of the GET parameters. | |
331 **/ | |
332 const char* const* getValues; | |
333 | |
334 /** | |
335 * @brief For a PUT or POST request, the content of the body. | |
336 **/ | |
899 | 337 const char* body; |
907 | 338 |
339 /** | |
340 * @brief For a PUT or POST request, the number of bytes of the body. | |
341 **/ | |
899 | 342 uint32_t bodySize; |
1041
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
343 |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
344 |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
345 /* -------------------------------------------------- |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
346 New in version 0.8.1 |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
347 -------------------------------------------------- */ |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
348 |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
349 /** |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
350 * @brief The number of HTTP headers. |
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 uint32_t headersCount; |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
353 |
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 * @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
|
356 **/ |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
357 const char* const* headersKeys; |
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 /** |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
360 * @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
|
361 **/ |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
362 const char* const* headersValues; |
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
363 |
899 | 364 } OrthancPluginHttpRequest; |
365 | |
1041
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
366 |
900 | 367 typedef enum |
886 | 368 { |
900 | 369 /* Generic services */ |
907 | 370 _OrthancPluginService_LogInfo = 1, |
371 _OrthancPluginService_LogWarning = 2, | |
372 _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
|
373 _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
|
374 _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
|
375 _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
|
376 _OrthancPluginService_SetPluginProperty = 7, |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
377 _OrthancPluginService_GetGlobalProperty = 8, |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
378 _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
|
379 _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
|
380 _OrthancPluginService_GetCommandLineArgument = 11, |
1407
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
381 _OrthancPluginService_GetExpectedDatabaseVersion = 12, |
1424
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
382 _OrthancPluginService_GetConfiguration = 13, |
1554
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
383 _OrthancPluginService_BufferCompression = 14, |
1588
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
384 _OrthancPluginService_ReadFile = 15, |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
385 _OrthancPluginService_WriteFile = 16, |
1593
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
386 _OrthancPluginService_GetErrorDescription = 17, |
1606
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
387 _OrthancPluginService_CallHttpClient = 18, |
1649
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
388 _OrthancPluginService_RegisterErrorCode = 19, |
1657
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
389 _OrthancPluginService_RegisterDictionaryTag = 20, |
1740
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
390 _OrthancPluginService_DicomBufferToJson = 21, |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
391 _OrthancPluginService_DicomInstanceToJson = 22, |
900 | 392 |
393 /* Registration of callbacks */ | |
907 | 394 _OrthancPluginService_RegisterRestCallback = 1000, |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
395 _OrthancPluginService_RegisterOnStoredInstanceCallback = 1001, |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
396 _OrthancPluginService_RegisterStorageArea = 1002, |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
397 _OrthancPluginService_RegisterOnChangeCallback = 1003, |
1595
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
398 _OrthancPluginService_RegisterRestCallbackNoLock = 1004, |
900 | 399 |
400 /* Sending answers to REST calls */ | |
907 | 401 _OrthancPluginService_AnswerBuffer = 2000, |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
402 _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
|
403 _OrthancPluginService_Redirect = 2002, |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
404 _OrthancPluginService_SendHttpStatusCode = 2003, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
405 _OrthancPluginService_SendUnauthorized = 2004, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
406 _OrthancPluginService_SendMethodNotAllowed = 2005, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
407 _OrthancPluginService_SetCookie = 2006, |
1137
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
408 _OrthancPluginService_SetHttpHeader = 2007, |
1430
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
409 _OrthancPluginService_StartMultipartAnswer = 2008, |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
410 _OrthancPluginService_SendMultipartItem = 2009, |
1593
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
411 _OrthancPluginService_SendHttpStatus = 2010, |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
412 _OrthancPluginService_CompressAndAnswerImage = 2011, |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
413 |
912
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
414 /* Access to the Orthanc database and API */ |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
415 _OrthancPluginService_GetDicomForInstance = 3000, |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
416 _OrthancPluginService_RestApiGet = 3001, |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
417 _OrthancPluginService_RestApiPost = 3002, |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
418 _OrthancPluginService_RestApiDelete = 3003, |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
419 _OrthancPluginService_RestApiPut = 3004, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
420 _OrthancPluginService_LookupPatient = 3005, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
421 _OrthancPluginService_LookupStudy = 3006, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
422 _OrthancPluginService_LookupSeries = 3007, |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
423 _OrthancPluginService_LookupInstance = 3008, |
1069
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
424 _OrthancPluginService_LookupStudyWithAccessionNumber = 3009, |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
425 _OrthancPluginService_RestApiGetAfterPlugins = 3010, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
426 _OrthancPluginService_RestApiPostAfterPlugins = 3011, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
427 _OrthancPluginService_RestApiDeleteAfterPlugins = 3012, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
428 _OrthancPluginService_RestApiPutAfterPlugins = 3013, |
1669
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
429 _OrthancPluginService_ReconstructMainDicomTags = 3014, |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
430 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
431 /* Access to DICOM instances */ |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
432 _OrthancPluginService_GetInstanceRemoteAet = 4000, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
433 _OrthancPluginService_GetInstanceSize = 4001, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
434 _OrthancPluginService_GetInstanceData = 4002, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
435 _OrthancPluginService_GetInstanceJson = 4003, |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
436 _OrthancPluginService_GetInstanceSimplifiedJson = 4004, |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
437 _OrthancPluginService_HasInstanceMetadata = 4005, |
1309
8f4487d8f79e
new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1303
diff
changeset
|
438 _OrthancPluginService_GetInstanceMetadata = 4006, |
8f4487d8f79e
new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1303
diff
changeset
|
439 |
8f4487d8f79e
new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1303
diff
changeset
|
440 /* 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
|
441 _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
|
442 _OrthancPluginService_DatabaseAnswer = 5001, |
1609
c74495267acf
Implementation of the "GetAllPublicIdsWithLimit" extension
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1608
diff
changeset
|
443 _OrthancPluginService_RegisterDatabaseBackendV2 = 5002, |
1615
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
444 _OrthancPluginService_StorageAreaCreate = 5003, |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
445 _OrthancPluginService_StorageAreaRead = 5004, |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
446 _OrthancPluginService_StorageAreaRemove = 5005, |
1309
8f4487d8f79e
new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1303
diff
changeset
|
447 |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
448 /* Primitives for handling images */ |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
449 _OrthancPluginService_GetImagePixelFormat = 6000, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
450 _OrthancPluginService_GetImageWidth = 6001, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
451 _OrthancPluginService_GetImageHeight = 6002, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
452 _OrthancPluginService_GetImagePitch = 6003, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
453 _OrthancPluginService_GetImageBuffer = 6004, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
454 _OrthancPluginService_UncompressImage = 6005, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
455 _OrthancPluginService_FreeImage = 6006, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
456 _OrthancPluginService_CompressImage = 6007, |
1608
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
457 _OrthancPluginService_ConvertPixelFormat = 6008, |
1613
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
458 _OrthancPluginService_GetFontsCount = 6009, |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
459 _OrthancPluginService_GetFontInfo = 6010, |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
460 _OrthancPluginService_DrawText = 6011, |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
461 |
1580
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
462 _OrthancPluginService_INTERNAL = 0x7fffffff |
907 | 463 } _OrthancPluginService; |
900 | 464 |
465 | |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
466 typedef enum |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
467 { |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
468 _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
|
469 _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
|
470 _OrthancPluginProperty_OrthancExplorer = 3, |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
471 |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
472 _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
|
473 } _OrthancPluginProperty; |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
474 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
475 |
900 | 476 |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
477 /** |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
478 * 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
|
479 * @ingroup Images |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
480 **/ |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
481 typedef enum |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
482 { |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
483 /** |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
484 * @brief Graylevel 8bpp image. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
485 * |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
486 * 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
|
487 * one byte. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
488 **/ |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
489 OrthancPluginPixelFormat_Grayscale8 = 1, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
490 |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
491 /** |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
492 * @brief Graylevel, unsigned 16bpp image. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
493 * |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
494 * 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
|
495 * two bytes. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
496 **/ |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
497 OrthancPluginPixelFormat_Grayscale16 = 2, |
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 /** |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
500 * @brief Graylevel, signed 16bpp image. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
501 * |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
502 * 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
|
503 * bytes. |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
504 **/ |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
505 OrthancPluginPixelFormat_SignedGrayscale16 = 3, |
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 /** |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
508 * @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
|
509 * |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
510 * 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
|
511 * 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
|
512 **/ |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
513 OrthancPluginPixelFormat_RGB24 = 4, |
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 /** |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
516 * @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
|
517 * |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
518 * 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
|
519 * 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
|
520 **/ |
1580
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
521 OrthancPluginPixelFormat_RGBA32 = 5, |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
522 |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
523 OrthancPluginPixelFormat_Unknown = 6, /*!< Unknown pixel format */ |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
524 |
1580
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
525 _OrthancPluginPixelFormat_INTERNAL = 0x7fffffff |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
526 } OrthancPluginPixelFormat; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
527 |
894 | 528 |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
529 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
530 /** |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
531 * 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
|
532 **/ |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
533 typedef enum |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
534 { |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
535 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
|
536 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
|
537 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
|
538 |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
539 _OrthancPluginContentType_INTERNAL = 0x7fffffff |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
540 } OrthancPluginContentType; |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
541 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
542 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
543 |
907 | 544 /** |
1554
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
545 * The supported types of DICOM resources. |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
546 **/ |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
547 typedef enum |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
548 { |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
549 OrthancPluginResourceType_Patient = 0, /*!< Patient */ |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
550 OrthancPluginResourceType_Study = 1, /*!< Study */ |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
551 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
|
552 OrthancPluginResourceType_Instance = 3, /*!< Instance */ |
1741
06addfcd1d4c
OrthancStarted and OrthancStopped events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1740
diff
changeset
|
553 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
|
554 |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
555 _OrthancPluginResourceType_INTERNAL = 0x7fffffff |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
556 } OrthancPluginResourceType; |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
557 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
558 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
559 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
560 /** |
1554
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
561 * 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
|
562 * @ingroup Callbacks |
1177
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 typedef enum |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
565 { |
1198 | 566 OrthancPluginChangeType_CompletedSeries = 0, /*!< Series is now complete */ |
567 OrthancPluginChangeType_Deleted = 1, /*!< Deleted resource */ | |
568 OrthancPluginChangeType_NewChildInstance = 2, /*!< A new instance was added to this resource */ | |
569 OrthancPluginChangeType_NewInstance = 3, /*!< New instance received */ | |
570 OrthancPluginChangeType_NewPatient = 4, /*!< New patient created */ | |
571 OrthancPluginChangeType_NewSeries = 5, /*!< New series created */ | |
572 OrthancPluginChangeType_NewStudy = 6, /*!< New study created */ | |
573 OrthancPluginChangeType_StablePatient = 7, /*!< Timeout: No new instance in this patient */ | |
574 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
|
575 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
|
576 OrthancPluginChangeType_OrthancStarted = 10, /*!< Orthanc has started */ |
06addfcd1d4c
OrthancStarted and OrthancStopped events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1740
diff
changeset
|
577 OrthancPluginChangeType_OrthancStopped = 11, /*!< Orthanc is stopping */ |
1580
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
578 |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
579 _OrthancPluginChangeType_INTERNAL = 0x7fffffff |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
580 } OrthancPluginChangeType; |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
581 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
582 |
1554
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
583 /** |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
584 * 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
|
585 * @ingroup Images |
1554
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
586 **/ |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
587 typedef enum |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
588 { |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
589 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
|
590 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
|
591 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
|
592 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
|
593 |
bf502300c52e
force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1579
diff
changeset
|
594 _OrthancPluginCompressionType_INTERNAL = 0x7fffffff |
1554
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
595 } OrthancPluginCompressionType; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
596 |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
597 |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
598 /** |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
599 * 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
|
600 * @ingroup Images |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
601 **/ |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
602 typedef enum |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
603 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
604 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
|
605 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
|
606 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
607 _OrthancPluginImageFormat_INTERNAL = 0x7fffffff |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
608 } OrthancPluginImageFormat; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
609 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
610 |
1657
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
611 /** |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
612 * 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
|
613 * @ingroup Toolbox |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
614 **/ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
615 typedef enum |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
616 { |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
617 OrthancPluginValueRepresentation_AE = 1, /*!< Application Entity */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
618 OrthancPluginValueRepresentation_AS = 2, /*!< Age String */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
619 OrthancPluginValueRepresentation_AT = 3, /*!< Attribute Tag */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
620 OrthancPluginValueRepresentation_CS = 4, /*!< Code String */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
621 OrthancPluginValueRepresentation_DA = 5, /*!< Date */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
622 OrthancPluginValueRepresentation_DS = 6, /*!< Decimal String */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
623 OrthancPluginValueRepresentation_DT = 7, /*!< Date Time */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
624 OrthancPluginValueRepresentation_FD = 8, /*!< Floating Point Double */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
625 OrthancPluginValueRepresentation_FL = 9, /*!< Floating Point Single */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
626 OrthancPluginValueRepresentation_IS = 10, /*!< Integer String */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
627 OrthancPluginValueRepresentation_LO = 11, /*!< Long String */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
628 OrthancPluginValueRepresentation_LT = 12, /*!< Long Text */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
629 OrthancPluginValueRepresentation_OB = 13, /*!< Other Byte String */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
630 OrthancPluginValueRepresentation_OF = 14, /*!< Other Float String */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
631 OrthancPluginValueRepresentation_OW = 15, /*!< Other Word String */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
632 OrthancPluginValueRepresentation_PN = 16, /*!< Person Name */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
633 OrthancPluginValueRepresentation_SH = 17, /*!< Short String */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
634 OrthancPluginValueRepresentation_SL = 18, /*!< Signed Long */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
635 OrthancPluginValueRepresentation_SQ = 19, /*!< Sequence of Items */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
636 OrthancPluginValueRepresentation_SS = 20, /*!< Signed Short */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
637 OrthancPluginValueRepresentation_ST = 21, /*!< Short Text */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
638 OrthancPluginValueRepresentation_TM = 22, /*!< Time */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
639 OrthancPluginValueRepresentation_UI = 23, /*!< Unique Identifier (UID) */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
640 OrthancPluginValueRepresentation_UL = 24, /*!< Unsigned Long */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
641 OrthancPluginValueRepresentation_UN = 25, /*!< Unknown */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
642 OrthancPluginValueRepresentation_US = 26, /*!< Unsigned Short */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
643 OrthancPluginValueRepresentation_UT = 27, /*!< Unlimited Text */ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
644 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
645 _OrthancPluginValueRepresentation_INTERNAL = 0x7fffffff |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
646 } OrthancPluginValueRepresentation; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
647 |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
648 |
1743 | 649 /** |
650 * The possible output formats for a DICOM-to-JSON conversion. | |
651 * @ingroup Toolbox | |
652 **/ | |
1740
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
653 typedef enum |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
654 { |
1743 | 655 OrthancPluginDicomToJsonFormat_Full = 1, /*!< Full output, with most details */ |
656 OrthancPluginDicomToJsonFormat_Short = 2, /*!< Tags output as hexadecimal numbers */ | |
657 OrthancPluginDicomToJsonFormat_Simple = 3, /*!< Human-readable JSON */ | |
1740
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
658 |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
659 _OrthancPluginDicomToJsonFormat_INTERNAL = 0x7fffffff |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
660 } OrthancPluginDicomToJsonFormat; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
661 |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
662 |
1743 | 663 /** |
664 * Flags to customize a DICOM-to-JSON conversion. By default, binary | |
665 * tags are formatted using Data URI scheme. | |
666 * @ingroup Toolbox | |
667 **/ | |
1740
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
668 typedef enum |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
669 { |
1743 | 670 OrthancPluginDicomToJsonFlags_IncludeBinary = (1 << 0), /*!< Include the binary tags */ |
671 OrthancPluginDicomToJsonFlags_IncludePrivateTags = (1 << 1), /*!< Include the private tags */ | |
672 OrthancPluginDicomToJsonFlags_IncludeUnknownTags = (1 << 2), /*!< Include the tags unknown by the dictionary */ | |
673 OrthancPluginDicomToJsonFlags_IncludePixelData = (1 << 3), /*!< Include the pixel data */ | |
674 OrthancPluginDicomToJsonFlags_ConvertBinaryToAscii = (1 << 4), /*!< Output binary tags as-is, dropping non-ASCII */ | |
675 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
|
676 |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
677 _OrthancPluginDicomToJsonFlags_INTERNAL = 0x7fffffff |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
678 } OrthancPluginDicomToJsonFlags; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
679 |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
680 |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
681 /** |
907 | 682 * @brief A memory buffer allocated by the core system of Orthanc. |
683 * | |
684 * A memory buffer allocated by the core system of Orthanc. When the | |
685 * content of the buffer is not useful anymore, it must be free by a | |
686 * call to ::OrthancPluginFreeMemoryBuffer(). | |
687 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
688 typedef struct |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
689 { |
907 | 690 /** |
691 * @brief The content of the buffer. | |
692 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
693 void* data; |
907 | 694 |
695 /** | |
696 * @brief The number of bytes in the buffer. | |
697 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
698 uint32_t size; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
699 } OrthancPluginMemoryBuffer; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
700 |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
701 |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
702 |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
703 |
907 | 704 /** |
705 * @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
|
706 * @ingroup Callback |
907 | 707 **/ |
900 | 708 typedef struct _OrthancPluginRestOutput_t OrthancPluginRestOutput; |
709 | |
907 | 710 |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
711 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
712 /** |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
713 * @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
|
714 **/ |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
715 typedef struct _OrthancPluginDicomInstance_t OrthancPluginDicomInstance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
716 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
717 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
718 |
907 | 719 /** |
1615
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
720 * @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
|
721 * @ingroup Images |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
722 **/ |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
723 typedef struct _OrthancPluginImage_t OrthancPluginImage; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
724 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
725 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
726 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
727 /** |
1615
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
728 * @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
|
729 * @ingroup Images |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
730 **/ |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
731 typedef struct _OrthancPluginStorageArea_t OrthancPluginStorageArea; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
732 |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
733 |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
734 |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
735 /** |
908
e078ea944089
refactoring HttpOutput
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
907
diff
changeset
|
736 * @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
|
737 * @ingroup Callbacks |
907 | 738 **/ |
1628
77c4cc4def0f
OrthancPluginErrorCode in REST callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1627
diff
changeset
|
739 typedef OrthancPluginErrorCode (*OrthancPluginRestCallback) ( |
900 | 740 OrthancPluginRestOutput* output, |
741 const char* url, | |
742 const OrthancPluginHttpRequest* request); | |
743 | |
907 | 744 |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
745 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
746 /** |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
747 * @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
|
748 * @ingroup Callbacks |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
749 **/ |
1627
da7854deb662
Plugin callbacks must now return explicit "OrthancPluginErrorCode" instead of integers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1615
diff
changeset
|
750 typedef OrthancPluginErrorCode (*OrthancPluginOnStoredInstanceCallback) ( |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
751 OrthancPluginDicomInstance* instance, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
752 const char* instanceId); |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
753 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
754 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
755 |
907 | 756 /** |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
757 * @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
|
758 * @ingroup Callbacks |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
759 **/ |
1627
da7854deb662
Plugin callbacks must now return explicit "OrthancPluginErrorCode" instead of integers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1615
diff
changeset
|
760 typedef OrthancPluginErrorCode (*OrthancPluginOnChangeCallback) ( |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
761 OrthancPluginChangeType changeType, |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
762 OrthancPluginResourceType resourceType, |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
763 const char* resourceId); |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
764 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
765 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
766 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
767 /** |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
768 * @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
|
769 **/ |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
770 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
|
771 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
772 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
773 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
774 /** |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
775 * @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
|
776 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
777 * 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
|
778 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
779 * @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
|
780 * @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
|
781 * @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
|
782 * @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
|
783 * @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
|
784 * @ingroup Callbacks |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
785 **/ |
1627
da7854deb662
Plugin callbacks must now return explicit "OrthancPluginErrorCode" instead of integers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1615
diff
changeset
|
786 typedef OrthancPluginErrorCode (*OrthancPluginStorageCreate) ( |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
787 const char* uuid, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
788 const void* content, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
789 int64_t size, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
790 OrthancPluginContentType type); |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
791 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
792 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
793 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
794 /** |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
795 * @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
|
796 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
797 * 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
|
798 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
799 * @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
|
800 * @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
|
801 * @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
|
802 * @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
|
803 * @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
|
804 * @ingroup Callbacks |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
805 **/ |
1627
da7854deb662
Plugin callbacks must now return explicit "OrthancPluginErrorCode" instead of integers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1615
diff
changeset
|
806 typedef OrthancPluginErrorCode (*OrthancPluginStorageRead) ( |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
807 void** content, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
808 int64_t* size, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
809 const char* uuid, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
810 OrthancPluginContentType type); |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
811 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
812 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
813 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
814 /** |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
815 * @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
|
816 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
817 * 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
|
818 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
819 * @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
|
820 * @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
|
821 * @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
|
822 * @ingroup Callbacks |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
823 **/ |
1627
da7854deb662
Plugin callbacks must now return explicit "OrthancPluginErrorCode" instead of integers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1615
diff
changeset
|
824 typedef OrthancPluginErrorCode (*OrthancPluginStorageRemove) ( |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
825 const char* uuid, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
826 OrthancPluginContentType type); |
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 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
829 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
830 /** |
1297 | 831 * @brief Data structure that contains information about the Orthanc core. |
907 | 832 **/ |
900 | 833 typedef struct _OrthancPluginContext_t |
834 { | |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
835 void* pluginsManager; |
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
836 const char* orthancVersion; |
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
837 OrthancPluginFree Free; |
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
838 OrthancPluginErrorCode (*InvokeService) (struct _OrthancPluginContext_t* context, |
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
839 _OrthancPluginService service, |
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
840 const void* params); |
899 | 841 } OrthancPluginContext; |
842 | |
886 | 843 |
907 | 844 |
845 /** | |
846 * @brief Free a string. | |
847 * | |
848 * Free a string that was allocated by the core system of Orthanc. | |
849 * | |
850 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
851 * @param str The string to be freed. | |
852 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
853 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeString( |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
854 OrthancPluginContext* context, |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
855 char* str) |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
856 { |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
857 if (str != NULL) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
858 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
859 context->Free(str); |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
860 } |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
861 } |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
862 |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
863 |
907 | 864 /** |
1041
2c49b7dffcec
plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1040
diff
changeset
|
865 * @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
|
866 * |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
867 * 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
|
868 * 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
|
869 * this function should always be checked in the |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
870 * OrthancPluginInitialize() entry point of the plugin. |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
871 * |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
872 * @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
|
873 * @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
|
874 * 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
|
875 * @ingroup Callbacks |
1039
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
876 **/ |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
877 ORTHANC_PLUGIN_INLINE int OrthancPluginCheckVersion( |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
878 OrthancPluginContext* context) |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
879 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
880 int major, minor, revision; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
881 |
1579
b93c398f934d
check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1578
diff
changeset
|
882 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
|
883 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
|
884 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
|
885 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
|
886 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
|
887 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
|
888 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
|
889 sizeof(int32_t) != sizeof(OrthancPluginChangeType) || |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
890 sizeof(int32_t) != sizeof(OrthancPluginCompressionType) || |
1657
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
891 sizeof(int32_t) != sizeof(OrthancPluginImageFormat) || |
1740
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
892 sizeof(int32_t) != sizeof(OrthancPluginValueRepresentation) || |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
893 sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFormat) || |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
894 sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFlags)) |
1578 | 895 { |
896 /* Mismatch in the size of the enumerations */ | |
897 return 0; | |
898 } | |
899 | |
1039
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
900 /* Assume compatibility with the mainline */ |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
901 if (!strcmp(context->orthancVersion, "mainline")) |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
902 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
903 return 1; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
904 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
905 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
906 /* Parse the version of the Orthanc core */ |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
907 if ( |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
908 #ifdef _MSC_VER |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
909 sscanf_s |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
910 #else |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
911 sscanf |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
912 #endif |
1303 | 913 (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
|
914 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
915 return 0; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
916 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
917 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
918 /* Check the major number of the version */ |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
919 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
920 if (major > ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER) |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
921 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
922 return 1; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
923 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
924 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
925 if (major < ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER) |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
926 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
927 return 0; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
928 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
929 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
930 /* Check the minor number of the version */ |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
931 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
932 if (minor > ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER) |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
933 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
934 return 1; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
935 } |
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 if (minor < ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER) |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
938 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
939 return 0; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
940 } |
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 /* Check the revision number of the version */ |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
943 |
1040
d06186cdc502
check plugin version in samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1039
diff
changeset
|
944 if (revision >= ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER) |
1039
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
945 { |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
946 return 1; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
947 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
948 else |
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 return 0; |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
951 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
952 } |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
953 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
954 |
5a5a4890ffca
check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1037
diff
changeset
|
955 /** |
907 | 956 * @brief Free a memory buffer. |
957 * | |
958 * Free a memory buffer that was allocated by the core system of Orthanc. | |
959 * | |
960 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
961 * @param buffer The memory buffer to release. | |
962 **/ | |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
963 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeMemoryBuffer( |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
964 OrthancPluginContext* context, |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
965 OrthancPluginMemoryBuffer* buffer) |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
966 { |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
967 context->Free(buffer->data); |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
968 } |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
969 |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
970 |
907 | 971 /** |
972 * @brief Log an error. | |
973 * | |
974 * Log an error message using the Orthanc logging system. | |
975 * | |
976 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
977 * @param message The message to be logged. | |
978 **/ | |
900 | 979 ORTHANC_PLUGIN_INLINE void OrthancPluginLogError( |
980 OrthancPluginContext* context, | |
907 | 981 const char* message) |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
982 { |
907 | 983 context->InvokeService(context, _OrthancPluginService_LogError, message); |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
984 } |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
985 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
986 |
907 | 987 /** |
988 * @brief Log a warning. | |
989 * | |
990 * Log a warning message using the Orthanc logging system. | |
991 * | |
992 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
993 * @param message The message to be logged. | |
994 **/ | |
900 | 995 ORTHANC_PLUGIN_INLINE void OrthancPluginLogWarning( |
996 OrthancPluginContext* context, | |
907 | 997 const char* message) |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
998 { |
907 | 999 context->InvokeService(context, _OrthancPluginService_LogWarning, message); |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
1000 } |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
1001 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
1002 |
907 | 1003 /** |
1004 * @brief Log an information. | |
1005 * | |
1006 * Log an information message using the Orthanc logging system. | |
1007 * | |
1008 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
1009 * @param message The message to be logged. | |
1010 **/ | |
900 | 1011 ORTHANC_PLUGIN_INLINE void OrthancPluginLogInfo( |
1012 OrthancPluginContext* context, | |
907 | 1013 const char* message) |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
1014 { |
907 | 1015 context->InvokeService(context, _OrthancPluginService_LogInfo, message); |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
1016 } |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
1017 |
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
1018 |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1019 |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1020 typedef struct |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1021 { |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1022 const char* pathRegularExpression; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1023 OrthancPluginRestCallback callback; |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1024 } _OrthancPluginRestCallback; |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1025 |
907 | 1026 /** |
1027 * @brief Register a REST callback. | |
1028 * | |
1029 * This function registers a REST callback against a regular | |
1030 * expression for a URI. This function must be called during the | |
1031 * initialization of the plugin, i.e. inside the | |
1032 * OrthancPluginInitialize() public function. | |
1595
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1033 * |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1034 * Each REST callback is guaranteed to run in mutual exclusion. |
907 | 1035 * |
1036 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
1037 * @param pathRegularExpression Regular expression for the URI. May contain groups. | |
1038 * @param callback The callback function to handle the REST call. | |
1595
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1039 * @see OrthancPluginRegisterRestCallbackNoLock() |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1040 * @ingroup Callbacks |
907 | 1041 **/ |
900 | 1042 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallback( |
1043 OrthancPluginContext* context, | |
1044 const char* pathRegularExpression, | |
1045 OrthancPluginRestCallback callback) | |
899 | 1046 { |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1047 _OrthancPluginRestCallback params; |
899 | 1048 params.pathRegularExpression = pathRegularExpression; |
1049 params.callback = callback; | |
907 | 1050 context->InvokeService(context, _OrthancPluginService_RegisterRestCallback, ¶ms); |
899 | 1051 } |
1052 | |
1053 | |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1054 |
1595
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1055 /** |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1056 * @brief Register a REST callback, without locking. |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1057 * |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1058 * This function registers a REST callback against a regular |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1059 * expression for a URI. This function must be called during the |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1060 * initialization of the plugin, i.e. inside the |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1061 * OrthancPluginInitialize() public function. |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1062 * |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1063 * Contrarily to OrthancPluginRegisterRestCallback(), the callback |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1064 * 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
|
1065 * high-performance plugins that must handle concurrent requests |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1066 * (Orthanc uses a pool of threads, one thread being assigned to |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1067 * 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
|
1068 * implement the required locking mechanisms. |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1069 * |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1070 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1071 * @param pathRegularExpression Regular expression for the URI. May contain groups. |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1072 * @param callback The callback function to handle the REST call. |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1073 * @see OrthancPluginRegisterRestCallback() |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1074 * @ingroup Callbacks |
1595
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1075 **/ |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1076 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallbackNoLock( |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1077 OrthancPluginContext* context, |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1078 const char* pathRegularExpression, |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1079 OrthancPluginRestCallback callback) |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1080 { |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1081 _OrthancPluginRestCallback params; |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1082 params.pathRegularExpression = pathRegularExpression; |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1083 params.callback = callback; |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1084 context->InvokeService(context, _OrthancPluginService_RegisterRestCallbackNoLock, ¶ms); |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1085 } |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1086 |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1087 |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
1088 |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1089 typedef struct |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1090 { |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1091 OrthancPluginOnStoredInstanceCallback callback; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1092 } _OrthancPluginOnStoredInstanceCallback; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1093 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1094 /** |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1095 * @brief Register a callback for received instances. |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1096 * |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1097 * This function registers a callback function that is called |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1098 * 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
|
1099 * |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1100 * @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
|
1101 * @param callback The callback function. |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1102 * @ingroup Callbacks |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1103 **/ |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1104 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnStoredInstanceCallback( |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1105 OrthancPluginContext* context, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1106 OrthancPluginOnStoredInstanceCallback callback) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1107 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1108 _OrthancPluginOnStoredInstanceCallback params; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1109 params.callback = callback; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1110 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1111 context->InvokeService(context, _OrthancPluginService_RegisterOnStoredInstanceCallback, ¶ms); |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1112 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1113 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1114 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1115 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1116 typedef struct |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1117 { |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1118 OrthancPluginRestOutput* output; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1119 const char* answer; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1120 uint32_t answerSize; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1121 const char* mimeType; |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1122 } _OrthancPluginAnswerBuffer; |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1123 |
907 | 1124 /** |
1125 * @brief Answer to a REST request. | |
1126 * | |
1127 * This function answers to a REST request with the content of a memory buffer. | |
1128 * | |
1129 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
1130 * @param output The HTTP connection to the client application. | |
1131 * @param answer Pointer to the memory buffer containing the answer. | |
1132 * @param answerSize Number of bytes of the answer. | |
1133 * @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
|
1134 * @ingroup REST |
907 | 1135 **/ |
900 | 1136 ORTHANC_PLUGIN_INLINE void OrthancPluginAnswerBuffer( |
1137 OrthancPluginContext* context, | |
1138 OrthancPluginRestOutput* output, | |
1139 const char* answer, | |
1140 uint32_t answerSize, | |
1141 const char* mimeType) | |
899 | 1142 { |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1143 _OrthancPluginAnswerBuffer params; |
899 | 1144 params.output = output; |
1145 params.answer = answer; | |
1146 params.answerSize = answerSize; | |
1147 params.mimeType = mimeType; | |
907 | 1148 context->InvokeService(context, _OrthancPluginService_AnswerBuffer, ¶ms); |
899 | 1149 } |
1150 | |
1151 | |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1152 typedef struct |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1153 { |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1154 OrthancPluginRestOutput* output; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1155 OrthancPluginPixelFormat format; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1156 uint32_t width; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1157 uint32_t height; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1158 uint32_t pitch; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1159 const void* buffer; |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1160 } _OrthancPluginCompressAndAnswerPngImage; |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1161 |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1162 typedef struct |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1163 { |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1164 OrthancPluginRestOutput* output; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1165 OrthancPluginImageFormat imageFormat; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1166 OrthancPluginPixelFormat pixelFormat; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1167 uint32_t width; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1168 uint32_t height; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1169 uint32_t pitch; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1170 const void* buffer; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1171 uint8_t quality; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1172 } _OrthancPluginCompressAndAnswerImage; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1173 |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1174 |
907 | 1175 /** |
1176 * @brief Answer to a REST request with a PNG image. | |
1177 * | |
1178 * This function answers to a REST request with a PNG image. The | |
1179 * parameters of this function describe a memory buffer that | |
1180 * contains an uncompressed image. The image will be automatically compressed | |
1181 * as a PNG image by the core system of Orthanc. | |
1182 * | |
1183 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
1184 * @param output The HTTP connection to the client application. | |
1185 * @param format The memory layout of the uncompressed image. | |
1186 * @param width The width of the image. | |
1187 * @param height The height of the image. | |
1188 * @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
|
1189 * between 2 successive lines of the image in the memory buffer). |
907 | 1190 * @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
|
1191 * @ingroup REST |
907 | 1192 **/ |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1193 ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerPngImage( |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1194 OrthancPluginContext* context, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1195 OrthancPluginRestOutput* output, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1196 OrthancPluginPixelFormat format, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1197 uint32_t width, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1198 uint32_t height, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1199 uint32_t pitch, |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1200 const void* buffer) |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1201 { |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1202 _OrthancPluginCompressAndAnswerImage params; |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1203 params.output = output; |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1204 params.imageFormat = OrthancPluginImageFormat_Png; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1205 params.pixelFormat = format; |
901
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1206 params.width = width; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1207 params.height = height; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1208 params.pitch = pitch; |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1209 params.buffer = buffer; |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1210 params.quality = 0; /* No quality for PNG */ |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
1211 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
|
1212 } |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1213 |
7d88f3f4a3b3
refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
900
diff
changeset
|
1214 |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1215 |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1216 typedef struct |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1217 { |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1218 OrthancPluginMemoryBuffer* target; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1219 const char* instanceId; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1220 } _OrthancPluginGetDicomForInstance; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1221 |
907 | 1222 /** |
1223 * @brief Retrieve a DICOM instance using its Orthanc identifier. | |
1224 * | |
1225 * Retrieve a DICOM instance using its Orthanc identifier. The DICOM | |
1226 * file is stored into a newly allocated memory buffer. | |
1227 * | |
1228 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
1229 * @param target The target memory buffer. | |
1230 * @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
|
1231 * @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
|
1232 * @ingroup Orthanc |
907 | 1233 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1234 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginGetDicomForInstance( |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1235 OrthancPluginContext* context, |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1236 OrthancPluginMemoryBuffer* target, |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1237 const char* instanceId) |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1238 { |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1239 _OrthancPluginGetDicomForInstance params; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1240 params.target = target; |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1241 params.instanceId = instanceId; |
907 | 1242 return context->InvokeService(context, _OrthancPluginService_GetDicomForInstance, ¶ms); |
904
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1243 } |
2732b5f57d9c
sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
901
diff
changeset
|
1244 |
898
7000fc86fe62
improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
897
diff
changeset
|
1245 |
912
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1246 |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1247 typedef struct |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1248 { |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1249 OrthancPluginMemoryBuffer* target; |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1250 const char* uri; |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1251 } _OrthancPluginRestApiGet; |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1252 |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1253 /** |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1254 * @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
|
1255 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1256 * 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
|
1257 * 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
|
1258 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1259 * @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
|
1260 * @param target The target memory buffer. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1261 * @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
|
1262 * @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
|
1263 * @see OrthancPluginRestApiGetAfterPlugins |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1264 * @ingroup Orthanc |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1265 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1266 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGet( |
912
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1267 OrthancPluginContext* context, |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1268 OrthancPluginMemoryBuffer* target, |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1269 const char* uri) |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1270 { |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1271 _OrthancPluginRestApiGet params; |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1272 params.target = target; |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1273 params.uri = uri; |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1274 return context->InvokeService(context, _OrthancPluginService_RestApiGet, ¶ms); |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1275 } |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1276 |
dcb2469f00f4
PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
908
diff
changeset
|
1277 |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1278 |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1279 /** |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1280 * @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
|
1281 * |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1282 * 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
|
1283 * 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
|
1284 * 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
|
1285 * 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
|
1286 * 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
|
1287 * |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1288 * @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
|
1289 * @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
|
1290 * @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
|
1291 * @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
|
1292 * @see OrthancPluginRestApiGet |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1293 * @ingroup Orthanc |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1294 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1295 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
|
1296 OrthancPluginContext* context, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1297 OrthancPluginMemoryBuffer* target, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1298 const char* uri) |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1299 { |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1300 _OrthancPluginRestApiGet params; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1301 params.target = target; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1302 params.uri = uri; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1303 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
|
1304 } |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1305 |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1306 |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1307 |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1308 typedef struct |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1309 { |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1310 OrthancPluginMemoryBuffer* target; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1311 const char* uri; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1312 const char* body; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1313 uint32_t bodySize; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1314 } _OrthancPluginRestApiPostPut; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1315 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1316 /** |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1317 * @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
|
1318 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1319 * 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
|
1320 * 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
|
1321 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1322 * @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
|
1323 * @param target The target memory buffer. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1324 * @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
|
1325 * @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
|
1326 * @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
|
1327 * @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
|
1328 * @see OrthancPluginRestApiPostAfterPlugins |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1329 * @ingroup Orthanc |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1330 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1331 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPost( |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1332 OrthancPluginContext* context, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1333 OrthancPluginMemoryBuffer* target, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1334 const char* uri, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1335 const char* body, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1336 uint32_t bodySize) |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1337 { |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1338 _OrthancPluginRestApiPostPut params; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1339 params.target = target; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1340 params.uri = uri; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1341 params.body = body; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1342 params.bodySize = bodySize; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1343 return context->InvokeService(context, _OrthancPluginService_RestApiPost, ¶ms); |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1344 } |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1345 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1346 |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1347 /** |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1348 * @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
|
1349 * |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1350 * 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
|
1351 * 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
|
1352 * 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
|
1353 * 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
|
1354 * 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
|
1355 * |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1356 * @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
|
1357 * @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
|
1358 * @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
|
1359 * @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
|
1360 * @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
|
1361 * @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
|
1362 * @see OrthancPluginRestApiPost |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1363 * @ingroup Orthanc |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1364 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1365 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
|
1366 OrthancPluginContext* context, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1367 OrthancPluginMemoryBuffer* target, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1368 const char* uri, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1369 const char* body, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1370 uint32_t bodySize) |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1371 { |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1372 _OrthancPluginRestApiPostPut params; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1373 params.target = target; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1374 params.uri = uri; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1375 params.body = body; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1376 params.bodySize = bodySize; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1377 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
|
1378 } |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1379 |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1380 |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1381 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1382 /** |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1383 * @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
|
1384 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1385 * 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
|
1386 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1387 * @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
|
1388 * @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
|
1389 * @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
|
1390 * @see OrthancPluginRestApiDeleteAfterPlugins |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1391 * @ingroup Orthanc |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1392 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1393 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiDelete( |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1394 OrthancPluginContext* context, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1395 const char* uri) |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1396 { |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1397 return context->InvokeService(context, _OrthancPluginService_RestApiDelete, uri); |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1398 } |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1399 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1400 |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1401 /** |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1402 * @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
|
1403 * |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1404 * 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
|
1405 * 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
|
1406 * 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
|
1407 * 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
|
1408 * |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1409 * @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
|
1410 * @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
|
1411 * @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
|
1412 * @see OrthancPluginRestApiDelete |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1413 * @ingroup Orthanc |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1414 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1415 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
|
1416 OrthancPluginContext* context, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1417 const char* uri) |
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 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
|
1420 } |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1421 |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1422 |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1423 |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1424 /** |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1425 * @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
|
1426 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1427 * 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
|
1428 * 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
|
1429 * |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1430 * @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
|
1431 * @param target The target memory buffer. |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1432 * @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
|
1433 * @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
|
1434 * @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
|
1435 * @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
|
1436 * @see OrthancPluginRestApiPutAfterPlugins |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1437 * @ingroup Orthanc |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1438 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1439 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPut( |
913
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1440 OrthancPluginContext* context, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1441 OrthancPluginMemoryBuffer* target, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1442 const char* uri, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1443 const char* body, |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1444 uint32_t bodySize) |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1445 { |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1446 _OrthancPluginRestApiPostPut params; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1447 params.target = target; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1448 params.uri = uri; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1449 params.body = body; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1450 params.bodySize = bodySize; |
3e43de893d88
POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
912
diff
changeset
|
1451 return context->InvokeService(context, _OrthancPluginService_RestApiPut, ¶ms); |
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 |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1455 |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1456 /** |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1457 * @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
|
1458 * |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1459 * 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
|
1460 * 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
|
1461 * 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
|
1462 * 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
|
1463 * 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
|
1464 * |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1465 * @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
|
1466 * @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
|
1467 * @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
|
1468 * @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
|
1469 * @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
|
1470 * @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
|
1471 * @see OrthancPluginRestApiPut |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1472 * @ingroup Orthanc |
1282
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1473 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
1474 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
|
1475 OrthancPluginContext* context, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1476 OrthancPluginMemoryBuffer* target, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1477 const char* uri, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1478 const char* body, |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1479 uint32_t bodySize) |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1480 { |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1481 _OrthancPluginRestApiPostPut params; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1482 params.target = target; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1483 params.uri = uri; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1484 params.body = body; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1485 params.bodySize = bodySize; |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1486 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
|
1487 } |
7bccdd221e2b
Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1280
diff
changeset
|
1488 |
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 |
993
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1491 typedef struct |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1492 { |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1493 OrthancPluginRestOutput* output; |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1494 const char* argument; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1495 } _OrthancPluginOutputPlusArgument; |
993
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1496 |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1497 /** |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1498 * @brief Redirect a REST request. |
993
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1499 * |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1500 * 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
|
1501 * to another URI using HTTP status 301. |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1502 * |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1503 * @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
|
1504 * @param output The HTTP connection to the client application. |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1505 * @param redirection Where to redirect. |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1506 * @ingroup REST |
993
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1507 **/ |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1508 ORTHANC_PLUGIN_INLINE void OrthancPluginRedirect( |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1509 OrthancPluginContext* context, |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1510 OrthancPluginRestOutput* output, |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1511 const char* redirection) |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1512 { |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1513 _OrthancPluginOutputPlusArgument params; |
993
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1514 params.output = output; |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1515 params.argument = redirection; |
993
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1516 context->InvokeService(context, _OrthancPluginService_Redirect, ¶ms); |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1517 } |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1518 |
501880d76474
improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
913
diff
changeset
|
1519 |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1520 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1521 typedef struct |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1522 { |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1523 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
|
1524 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
|
1525 } _OrthancPluginRetrieveDynamicString; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1526 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1527 /** |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1528 * @brief Look for a patient. |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1529 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1530 * 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
|
1531 * 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
|
1532 * over all the stored patients). |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1533 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1534 * @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
|
1535 * @param patientID The Patient ID of interest. |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1536 * @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
|
1537 * 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
|
1538 * @ingroup Orthanc |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1539 **/ |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1540 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupPatient( |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1541 OrthancPluginContext* context, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1542 const char* patientID) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1543 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1544 char* result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1545 |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1546 _OrthancPluginRetrieveDynamicString params; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1547 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
|
1548 params.argument = patientID; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1549 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
1550 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
|
1551 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1552 /* Error */ |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1553 return NULL; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1554 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1555 else |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1556 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1557 return result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1558 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1559 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1560 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1561 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1562 /** |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1563 * @brief Look for a study. |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1564 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1565 * 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
|
1566 * 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
|
1567 * over all the stored studies). |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1568 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1569 * @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
|
1570 * @param studyUID The Study Instance UID of interest. |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1571 * @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
|
1572 * 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
|
1573 * @ingroup Orthanc |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1574 **/ |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1575 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudy( |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1576 OrthancPluginContext* context, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1577 const char* studyUID) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1578 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1579 char* result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1580 |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1581 _OrthancPluginRetrieveDynamicString params; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1582 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
|
1583 params.argument = studyUID; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1584 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
1585 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
|
1586 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1587 /* Error */ |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1588 return NULL; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1589 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1590 else |
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 return result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1593 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1594 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1595 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1596 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1597 /** |
1069
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1598 * @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
|
1599 * |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1600 * 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
|
1601 * 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
|
1602 * over all the stored studies). |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1603 * |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1604 * @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
|
1605 * @param accessionNumber The Accession Number of interest. |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1606 * @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
|
1607 * 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
|
1608 * @ingroup Orthanc |
1069
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1609 **/ |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1610 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudyWithAccessionNumber( |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1611 OrthancPluginContext* context, |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1612 const char* accessionNumber) |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1613 { |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1614 char* result; |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1615 |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1616 _OrthancPluginRetrieveDynamicString params; |
1069
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1617 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
|
1618 params.argument = accessionNumber; |
1069
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1619 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
1620 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
|
1621 { |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1622 /* Error */ |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1623 return NULL; |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1624 } |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1625 else |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1626 { |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1627 return result; |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1628 } |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1629 } |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1630 |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1631 |
a91b4900f06a
plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1068
diff
changeset
|
1632 /** |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1633 * @brief Look for a series. |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1634 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1635 * 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
|
1636 * 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
|
1637 * over all the stored series). |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1638 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1639 * @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
|
1640 * @param seriesUID The Series Instance UID of interest. |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1641 * @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
|
1642 * 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
|
1643 * @ingroup Orthanc |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1644 **/ |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1645 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupSeries( |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1646 OrthancPluginContext* context, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1647 const char* seriesUID) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1648 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1649 char* result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1650 |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1651 _OrthancPluginRetrieveDynamicString params; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1652 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
|
1653 params.argument = seriesUID; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1654 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
1655 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
|
1656 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1657 /* Error */ |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1658 return NULL; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1659 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1660 else |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1661 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1662 return result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1663 } |
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 * @brief Look for an instance. |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1669 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1670 * 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
|
1671 * 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
|
1672 * over all the stored instances). |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1673 * |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1674 * @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
|
1675 * @param sopInstanceUID The SOP Instance UID of interest. |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1676 * @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
|
1677 * 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
|
1678 * @ingroup Orthanc |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1679 **/ |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1680 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupInstance( |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1681 OrthancPluginContext* context, |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1682 const char* sopInstanceUID) |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1683 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1684 char* result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1685 |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
1686 _OrthancPluginRetrieveDynamicString params; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1687 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
|
1688 params.argument = sopInstanceUID; |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1689 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
1690 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
|
1691 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1692 /* Error */ |
1037
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1693 return NULL; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1694 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1695 else |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1696 { |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1697 return result; |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1698 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1699 } |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1700 |
6208ab500ffd
LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1027
diff
changeset
|
1701 |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1702 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1703 typedef struct |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1704 { |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1705 OrthancPluginRestOutput* output; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1706 uint16_t status; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1707 } _OrthancPluginSendHttpStatusCode; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1708 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1709 /** |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1710 * @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
|
1711 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1712 * 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
|
1713 * 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
|
1714 * - 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
|
1715 * - 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
|
1716 * - 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
|
1717 * - 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
|
1718 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1719 * @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
|
1720 * @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
|
1721 * @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
|
1722 * @ingroup REST |
1594
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
1723 * @see OrthancPluginSendHttpStatus() |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1724 **/ |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1725 ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatusCode( |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1726 OrthancPluginContext* context, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1727 OrthancPluginRestOutput* output, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1728 uint16_t status) |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1729 { |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1730 _OrthancPluginSendHttpStatusCode params; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1731 params.output = output; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1732 params.status = status; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1733 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
|
1734 } |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1735 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1736 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1737 /** |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1738 * @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
|
1739 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1740 * 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
|
1741 * not authorized. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1742 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1743 * @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
|
1744 * @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
|
1745 * @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
|
1746 * @ingroup REST |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1747 **/ |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1748 ORTHANC_PLUGIN_INLINE void OrthancPluginSendUnauthorized( |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1749 OrthancPluginContext* context, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1750 OrthancPluginRestOutput* output, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1751 const char* realm) |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1752 { |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1753 _OrthancPluginOutputPlusArgument params; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1754 params.output = output; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1755 params.argument = realm; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1756 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
|
1757 } |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1758 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1759 |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1760 /** |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1761 * @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
|
1762 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1763 * 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
|
1764 * 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
|
1765 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1766 * @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
|
1767 * @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
|
1768 * @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
|
1769 * @ingroup REST |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1770 **/ |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1771 ORTHANC_PLUGIN_INLINE void OrthancPluginSendMethodNotAllowed( |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1772 OrthancPluginContext* context, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1773 OrthancPluginRestOutput* output, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1774 const char* allowedMethods) |
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 _OrthancPluginOutputPlusArgument params; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1777 params.output = output; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1778 params.argument = allowedMethods; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1779 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
|
1780 } |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1781 |
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 typedef struct |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1784 { |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1785 OrthancPluginRestOutput* output; |
1137
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1786 const char* key; |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1787 const char* value; |
1137
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1788 } _OrthancPluginSetHttpHeader; |
1042
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 /** |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1791 * @brief Set a cookie. |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1792 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1793 * 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
|
1794 * |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1795 * @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
|
1796 * @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
|
1797 * @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
|
1798 * @param value The value of the cookie. |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1799 * @ingroup REST |
1042
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 ORTHANC_PLUGIN_INLINE void OrthancPluginSetCookie( |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1802 OrthancPluginContext* context, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1803 OrthancPluginRestOutput* output, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1804 const char* cookie, |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1805 const char* value) |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1806 { |
1137
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1807 _OrthancPluginSetHttpHeader params; |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1808 params.output = output; |
1137
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1809 params.key = cookie; |
1042
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1810 params.value = value; |
8d1845feb277
set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1041
diff
changeset
|
1811 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
|
1812 } |
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 |
1137
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1815 /** |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1816 * @brief Set some HTTP header. |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1817 * |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1818 * This function sets a HTTP header in the HTTP answer. |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1819 * |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1820 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1821 * @param output The HTTP connection to the client application. |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1822 * @param key The HTTP header to be set. |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1823 * @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
|
1824 * @ingroup REST |
1137
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1825 **/ |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1826 ORTHANC_PLUGIN_INLINE void OrthancPluginSetHttpHeader( |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1827 OrthancPluginContext* context, |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1828 OrthancPluginRestOutput* output, |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1829 const char* key, |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1830 const char* value) |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1831 { |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1832 _OrthancPluginSetHttpHeader params; |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1833 params.output = output; |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1834 params.key = key; |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1835 params.value = value; |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1836 context->InvokeService(context, _OrthancPluginService_SetHttpHeader, ¶ms); |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1837 } |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1838 |
d9c27f9f1a51
OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1136
diff
changeset
|
1839 |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1840 typedef struct |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1841 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1842 char** resultStringToFree; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1843 const char** resultString; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1844 int64_t* resultInt64; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1845 const char* key; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1846 OrthancPluginDicomInstance* instance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1847 } _OrthancPluginAccessDicomInstance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1848 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1849 |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1850 /** |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1851 * @brief Get the AET of a DICOM instance. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1852 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1853 * 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
|
1854 * DICOM modality from which a DICOM instance originates. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1855 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1856 * @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
|
1857 * @param instance The instance of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1858 * @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
|
1859 * @ingroup Callbacks |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1860 **/ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1861 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceRemoteAet( |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1862 OrthancPluginContext* context, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1863 OrthancPluginDicomInstance* instance) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1864 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1865 const char* result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1866 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1867 _OrthancPluginAccessDicomInstance params; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1868 memset(¶ms, 0, sizeof(params)); |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1869 params.resultString = &result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1870 params.instance = instance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1871 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
1872 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
|
1873 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1874 /* Error */ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1875 return NULL; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1876 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1877 else |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1878 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1879 return result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1880 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1881 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1882 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1883 |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1884 /** |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1885 * @brief Get the size of a DICOM file. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1886 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1887 * 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
|
1888 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1889 * @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
|
1890 * @param instance The instance of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1891 * @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
|
1892 * @ingroup Callbacks |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1893 **/ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1894 ORTHANC_PLUGIN_INLINE int64_t OrthancPluginGetInstanceSize( |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1895 OrthancPluginContext* context, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1896 OrthancPluginDicomInstance* instance) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1897 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1898 int64_t size; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1899 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1900 _OrthancPluginAccessDicomInstance params; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1901 memset(¶ms, 0, sizeof(params)); |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1902 params.resultInt64 = &size; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1903 params.instance = instance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1904 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
1905 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
|
1906 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1907 /* Error */ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1908 return -1; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1909 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1910 else |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1911 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1912 return size; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1913 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1914 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1915 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1916 |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1917 /** |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1918 * @brief Get the data of a DICOM file. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1919 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1920 * 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
|
1921 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1922 * @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
|
1923 * @param instance The instance of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1924 * @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
|
1925 * @ingroup Callbacks |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1926 **/ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1927 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceData( |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1928 OrthancPluginContext* context, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1929 OrthancPluginDicomInstance* instance) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1930 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1931 const char* result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1932 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1933 _OrthancPluginAccessDicomInstance params; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1934 memset(¶ms, 0, sizeof(params)); |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1935 params.resultString = &result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1936 params.instance = instance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1937 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
1938 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
|
1939 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1940 /* Error */ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1941 return NULL; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1942 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1943 else |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1944 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1945 return result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1946 } |
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 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1949 |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1950 /** |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1951 * @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
|
1952 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1953 * 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
|
1954 * 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
|
1955 * of the given DICOM instance. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1956 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1957 * @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
|
1958 * @param instance The instance of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1959 * @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
|
1960 * This string must be freed by OrthancPluginFreeString(). |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1961 * @ingroup Callbacks |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1962 **/ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1963 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceJson( |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1964 OrthancPluginContext* context, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1965 OrthancPluginDicomInstance* instance) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1966 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1967 char* result; |
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 _OrthancPluginAccessDicomInstance params; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1970 memset(¶ms, 0, sizeof(params)); |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1971 params.resultStringToFree = &result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1972 params.instance = instance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1973 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
1974 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
|
1975 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
1976 /* Error */ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1977 return NULL; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1978 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
1979 else |
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 return result; |
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 } |
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 |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1986 /** |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1987 * @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
|
1988 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1989 * 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
|
1990 * 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
|
1991 * of the given DICOM instance. In contrast with |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1992 * ::OrthancPluginGetInstanceJson(), the returned JSON file is in |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1993 * its simplified version. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1994 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1995 * @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
|
1996 * @param instance The instance of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
1997 * @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
|
1998 * This string must be freed by OrthancPluginFreeString(). |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
1999 * @ingroup Callbacks |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2000 **/ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2001 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceSimplifiedJson( |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2002 OrthancPluginContext* context, |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2003 OrthancPluginDicomInstance* instance) |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2004 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2005 char* result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2006 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2007 _OrthancPluginAccessDicomInstance params; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2008 memset(¶ms, 0, sizeof(params)); |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2009 params.resultStringToFree = &result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2010 params.instance = instance; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2011 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2012 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
|
2013 { |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2014 /* Error */ |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2015 return NULL; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2016 } |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2017 else |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2018 { |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2019 return result; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2020 } |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2021 } |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2022 |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2023 |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2024 /** |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2025 * @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
|
2026 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2027 * 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
|
2028 * 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
|
2029 * callbacks registered by |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2030 * ::OrthancPluginRegisterOnStoredInstanceCallback(), the only |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2031 * possibly available metadata are "ReceptionDate", "RemoteAET" and |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2032 * "IndexInSeries". |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2033 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2034 * @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
|
2035 * @param instance The instance of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2036 * @param metadata The metadata of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2037 * @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
|
2038 * @ingroup Callbacks |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2039 **/ |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2040 ORTHANC_PLUGIN_INLINE int OrthancPluginHasInstanceMetadata( |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2041 OrthancPluginContext* context, |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2042 OrthancPluginDicomInstance* instance, |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2043 const char* metadata) |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2044 { |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2045 int64_t result; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2046 |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2047 _OrthancPluginAccessDicomInstance params; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2048 memset(¶ms, 0, sizeof(params)); |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2049 params.resultInt64 = &result; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2050 params.instance = instance; |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2051 params.key = metadata; |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2052 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2053 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
|
2054 { |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2055 /* Error */ |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2056 return -1; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2057 } |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2058 else |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2059 { |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2060 return (result != 0); |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2061 } |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2062 } |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2063 |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2064 |
1068
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 * @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
|
2067 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2068 * 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
|
2069 * 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
|
2070 * ::OrthancPluginHasInstanceMetadata(). |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2071 * |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2072 * @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
|
2073 * @param instance The instance of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2074 * @param metadata The metadata of interest. |
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2075 * @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
|
2076 * @ingroup Callbacks |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2077 **/ |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2078 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceMetadata( |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2079 OrthancPluginContext* context, |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2080 OrthancPluginDicomInstance* instance, |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2081 const char* metadata) |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2082 { |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2083 const char* result; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2084 |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2085 _OrthancPluginAccessDicomInstance params; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2086 memset(¶ms, 0, sizeof(params)); |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2087 params.resultString = &result; |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2088 params.instance = instance; |
1068
f54a9c6fea5d
documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1067
diff
changeset
|
2089 params.key = metadata; |
1067
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2090 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2091 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
|
2092 { |
ace99e272203
access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1066
diff
changeset
|
2093 /* Error */ |
1066
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2094 return NULL; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2095 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2096 else |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2097 { |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2098 return result; |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2099 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2100 } |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2101 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2102 |
bb82e5e818e9
OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1042
diff
changeset
|
2103 |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2104 typedef struct |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2105 { |
1295 | 2106 OrthancPluginStorageCreate create; |
2107 OrthancPluginStorageRead read; | |
2108 OrthancPluginStorageRemove remove; | |
2109 OrthancPluginFree free; | |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2110 } _OrthancPluginRegisterStorageArea; |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2111 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2112 /** |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2113 * @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
|
2114 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2115 * 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
|
2116 * 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
|
2117 * 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
|
2118 * 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
|
2119 * |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2120 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
1141 | 2121 * @param create The callback function to store a file on the custom storage area. |
2122 * @param read The callback function to read a file from the custom storage area. | |
2123 * @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
|
2124 * @ingroup Callbacks |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2125 **/ |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2126 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
|
2127 OrthancPluginContext* context, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2128 OrthancPluginStorageCreate create, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2129 OrthancPluginStorageRead read, |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2130 OrthancPluginStorageRemove remove) |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2131 { |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2132 _OrthancPluginRegisterStorageArea params; |
1295 | 2133 params.create = create; |
2134 params.read = read; | |
2135 params.remove = remove; | |
1136
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1135
diff
changeset
|
2136 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1135
diff
changeset
|
2137 #ifdef __cplusplus |
1295 | 2138 params.free = ::free; |
1136
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1135
diff
changeset
|
2139 #else |
1295 | 2140 params.free = free; |
1136
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1135
diff
changeset
|
2141 #endif |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1135
diff
changeset
|
2142 |
1135
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2143 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
|
2144 } |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2145 |
67c3c1e4a6e0
index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1069
diff
changeset
|
2146 |
1145
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2147 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2148 /** |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2149 * @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
|
2150 * |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2151 * 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
|
2152 * |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2153 * @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
|
2154 * @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
|
2155 * 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
|
2156 * OrthancPluginFreeString(). |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2157 **/ |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2158 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
|
2159 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2160 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
|
2161 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2162 _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
|
2163 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
|
2164 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
|
2165 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2166 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
|
2167 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2168 /* Error */ |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2169 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
|
2170 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2171 else |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2172 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2173 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
|
2174 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2175 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2176 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2177 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2178 /** |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2179 * @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
|
2180 * |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2181 * 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
|
2182 * |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2183 * @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
|
2184 * @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
|
2185 * 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
|
2186 * OrthancPluginFreeString(). |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2187 **/ |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2188 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
|
2189 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2190 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
|
2191 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2192 _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
|
2193 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
|
2194 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
|
2195 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2196 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
|
2197 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2198 /* Error */ |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2199 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
|
2200 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2201 else |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2202 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2203 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
|
2204 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2205 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2206 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2207 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2208 /** |
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
|
2209 * @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
|
2210 * |
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
|
2211 * 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
|
2212 * 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
|
2213 * 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
|
2214 * files. This function is deprecated in favor of |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2215 * 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
|
2216 * |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2217 * @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
|
2218 * @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
|
2219 * 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
|
2220 * OrthancPluginFreeString(). |
1424
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2221 * @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
|
2222 **/ |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2223 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
|
2224 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2225 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
|
2226 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2227 _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
|
2228 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
|
2229 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
|
2230 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2231 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
|
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 /* Error */ |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2234 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
|
2235 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2236 else |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2237 { |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2238 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
|
2239 } |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2240 } |
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 |
0479d02c6778
Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1141
diff
changeset
|
2243 |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2244 typedef struct |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2245 { |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2246 OrthancPluginOnChangeCallback callback; |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2247 } _OrthancPluginOnChangeCallback; |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2248 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2249 /** |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2250 * @brief Register a callback to monitor changes. |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2251 * |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2252 * 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
|
2253 * whenever a change happens to some DICOM resource. |
1642
0669d05b6de1
warning about OrthancPluginRegisterOnChangeCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1630
diff
changeset
|
2254 * |
0669d05b6de1
warning about OrthancPluginRegisterOnChangeCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1630
diff
changeset
|
2255 * @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
|
2256 * 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
|
2257 * the events passing through a message queue). Otherwise, this |
0669d05b6de1
warning about OrthancPluginRegisterOnChangeCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1630
diff
changeset
|
2258 * 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
|
2259 * script. |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2260 * |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2261 * @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
|
2262 * @param callback The callback function. |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
2263 * @ingroup Callbacks |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2264 **/ |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2265 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnChangeCallback( |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2266 OrthancPluginContext* context, |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2267 OrthancPluginOnChangeCallback callback) |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2268 { |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2269 _OrthancPluginOnChangeCallback params; |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2270 params.callback = callback; |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2271 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2272 context->InvokeService(context, _OrthancPluginService_RegisterOnChangeCallback, ¶ms); |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2273 } |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2274 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2275 |
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2276 |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2277 typedef struct |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2278 { |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2279 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
|
2280 _OrthancPluginProperty property; |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2281 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
|
2282 } _OrthancPluginSetPluginProperty; |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2283 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2284 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2285 /** |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2286 * @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
|
2287 * |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2288 * 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
|
2289 * 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
|
2290 * 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
|
2291 * Explorer. |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2292 * |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2293 * @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
|
2294 * @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
|
2295 **/ |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2296 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
|
2297 OrthancPluginContext* context, |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2298 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
|
2299 { |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2300 _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
|
2301 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
|
2302 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
|
2303 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
|
2304 |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2305 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
|
2306 } |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2307 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2308 |
1233 | 2309 /** |
2310 * @brief Set a description for this plugin. | |
2311 * | |
2312 * Set a description for this plugin. It is displayed in the | |
2313 * "Plugins" page of Orthanc Explorer. | |
2314 * | |
2315 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
2316 * @param description The description. | |
2317 **/ | |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2318 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
|
2319 OrthancPluginContext* context, |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2320 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
|
2321 { |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2322 _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
|
2323 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
|
2324 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
|
2325 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
|
2326 |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2327 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
|
2328 } |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2329 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2330 |
1233 | 2331 /** |
2332 * @brief Extend the JavaScript code of Orthanc Explorer. | |
2333 * | |
2334 * Add JavaScript code to customize the default behavior of Orthanc | |
2335 * Explorer. This can for instance be used to add new buttons. | |
2336 * | |
2337 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
2338 * @param javascript The custom JavaScript code. | |
2339 **/ | |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2340 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
|
2341 OrthancPluginContext* context, |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1198
diff
changeset
|
2342 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
|
2343 { |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2344 _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
|
2345 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
|
2346 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
|
2347 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
|
2348 |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2349 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
|
2350 } |
1177
5b2d8c280ac2
Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1145
diff
changeset
|
2351 |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2352 |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2353 typedef struct |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2354 { |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2355 char** result; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2356 int32_t property; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2357 const char* value; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2358 } _OrthancPluginGlobalProperty; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2359 |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2360 |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2361 /** |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2362 * @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
|
2363 * |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2364 * 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
|
2365 * 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
|
2366 * |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2367 * @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
|
2368 * @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
|
2369 * @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
|
2370 * @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
|
2371 * string must be freed by OrthancPluginFreeString(). |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
2372 * @ingroup Orthanc |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2373 **/ |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2374 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
|
2375 OrthancPluginContext* context, |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2376 int32_t property, |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2377 const char* defaultValue) |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2378 { |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2379 char* result; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2380 |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2381 _OrthancPluginGlobalProperty params; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2382 params.result = &result; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2383 params.property = property; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2384 params.value = defaultValue; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2385 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2386 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
|
2387 { |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2388 /* Error */ |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2389 return NULL; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2390 } |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2391 else |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2392 { |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2393 return result; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2394 } |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2395 } |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2396 |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2397 |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2398 /** |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2399 * @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
|
2400 * |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2401 * 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
|
2402 * 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
|
2403 * 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
|
2404 * 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
|
2405 * 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
|
2406 * |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2407 * @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
|
2408 * @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
|
2409 * @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
|
2410 * @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
|
2411 * @ingroup Orthanc |
1249
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2412 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
2413 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
|
2414 OrthancPluginContext* context, |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2415 int32_t property, |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2416 const char* value) |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2417 { |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2418 _OrthancPluginGlobalProperty params; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2419 params.result = NULL; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2420 params.property = property; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2421 params.value = value; |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2422 |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
2423 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
|
2424 } |
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 |
40725595aaf0
Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1233
diff
changeset
|
2427 |
1280
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2428 typedef struct |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2429 { |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2430 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
|
2431 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
|
2432 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
|
2433 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
|
2434 } _OrthancPluginReturnSingleValue; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2435 |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2436 /** |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2437 * @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
|
2438 * |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2439 * 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
|
2440 * |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2441 * @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
|
2442 * @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
|
2443 **/ |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2444 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
|
2445 OrthancPluginContext* context) |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2446 { |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2447 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
|
2448 |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2449 _OrthancPluginReturnSingleValue params; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2450 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
|
2451 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
|
2452 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2453 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
|
2454 { |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2455 /* Error */ |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2456 return 0; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2457 } |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2458 else |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2459 { |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2460 return count; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2461 } |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2462 } |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2463 |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2464 |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2465 |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2466 /** |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2467 * @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
|
2468 * |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2469 * 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
|
2470 * 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
|
2471 * 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
|
2472 * |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2473 * @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
|
2474 * @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
|
2475 * @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
|
2476 * 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
|
2477 **/ |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2478 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
|
2479 OrthancPluginContext* context, |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2480 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
|
2481 { |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2482 char* result; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2483 |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2484 _OrthancPluginGlobalProperty params; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2485 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
|
2486 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
|
2487 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
|
2488 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2489 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
|
2490 { |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2491 /* Error */ |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2492 return NULL; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2493 } |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2494 else |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2495 { |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2496 return result; |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2497 } |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2498 } |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2499 |
d6a65dc6d0ac
Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1249
diff
changeset
|
2500 |
1407
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2501 /** |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2502 * @brief Get the expected version of the database schema. |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2503 * |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2504 * Retrieve the expected version of the database schema. |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2505 * |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2506 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2507 * @return The version. |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
2508 * @ingroup Callbacks |
1615
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
2509 * @deprecated Please instead use IDatabaseBackend::UpgradeDatabase() |
1407
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2510 **/ |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2511 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetExpectedDatabaseVersion( |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2512 OrthancPluginContext* context) |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2513 { |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2514 uint32_t count = 0; |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2515 |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2516 _OrthancPluginReturnSingleValue params; |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2517 memset(¶ms, 0, sizeof(params)); |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2518 params.resultUint32 = &count; |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2519 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2520 if (context->InvokeService(context, _OrthancPluginService_GetExpectedDatabaseVersion, ¶ms) != OrthancPluginErrorCode_Success) |
1407
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2521 { |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2522 /* Error */ |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2523 return 0; |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2524 } |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2525 else |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2526 { |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2527 return count; |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2528 } |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2529 } |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2530 |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2531 |
d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1322
diff
changeset
|
2532 |
1424
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2533 /** |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2534 * @brief Return the content of the configuration file(s). |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2535 * |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2536 * This function returns the content of the configuration that is |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2537 * used by Orthanc, formatted as a JSON string. |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2538 * |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2539 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2540 * @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
|
2541 * containing the configuration. This string must be freed by |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2542 * OrthancPluginFreeString(). |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2543 **/ |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2544 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfiguration(OrthancPluginContext* context) |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2545 { |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2546 char* result; |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2547 |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2548 _OrthancPluginRetrieveDynamicString params; |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2549 params.result = &result; |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2550 params.argument = NULL; |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2551 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2552 if (context->InvokeService(context, _OrthancPluginService_GetConfiguration, ¶ms) != OrthancPluginErrorCode_Success) |
1424
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2553 { |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2554 /* Error */ |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2555 return NULL; |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2556 } |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2557 else |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2558 { |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2559 return result; |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2560 } |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2561 } |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2562 |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2563 |
fe384a9d3b51
OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1423
diff
changeset
|
2564 |
1430
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2565 typedef struct |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2566 { |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2567 OrthancPluginRestOutput* output; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2568 const char* subType; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2569 const char* contentType; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2570 } _OrthancPluginStartMultipartAnswer; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2571 |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2572 /** |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2573 * @brief Start an HTTP multipart answer. |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2574 * |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2575 * 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
|
2576 * |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2577 * @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
|
2578 * @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
|
2579 * @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
|
2580 * @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
|
2581 * @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
|
2582 * @see OrthancPluginSendMultipartItem() |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
2583 * @ingroup REST |
1430
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2584 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
2585 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStartMultipartAnswer( |
1430
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2586 OrthancPluginContext* context, |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2587 OrthancPluginRestOutput* output, |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2588 const char* subType, |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2589 const char* contentType) |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2590 { |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2591 _OrthancPluginStartMultipartAnswer params; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2592 params.output = output; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2593 params.subType = subType; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2594 params.contentType = contentType; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2595 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
|
2596 } |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2597 |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2598 |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2599 /** |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2600 * @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
|
2601 * |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2602 * 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
|
2603 * answer that was initiated by OrthancPluginStartMultipartAnswer(). |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2604 * |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2605 * @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
|
2606 * @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
|
2607 * @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
|
2608 * @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
|
2609 * @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
|
2610 * 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
|
2611 * @ingroup REST |
1430
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2612 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
2613 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSendMultipartItem( |
1430
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2614 OrthancPluginContext* context, |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2615 OrthancPluginRestOutput* output, |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2616 const char* answer, |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2617 uint32_t answerSize) |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2618 { |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2619 _OrthancPluginAnswerBuffer params; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2620 params.output = output; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2621 params.answer = answer; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2622 params.answerSize = answerSize; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2623 params.mimeType = NULL; |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2624 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
|
2625 } |
ad94a3583b07
Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1426
diff
changeset
|
2626 |
1554
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2627 |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2628 |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2629 typedef struct |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2630 { |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2631 OrthancPluginMemoryBuffer* target; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2632 const void* source; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2633 uint32_t size; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2634 OrthancPluginCompressionType compression; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2635 uint8_t uncompress; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2636 } _OrthancPluginBufferCompression; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2637 |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2638 |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2639 /** |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2640 * @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
|
2641 * |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2642 * 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
|
2643 * 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
|
2644 * |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2645 * @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
|
2646 * @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
|
2647 * @param source The source buffer. |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2648 * @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
|
2649 * @param compression The compression algorithm. |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2650 * @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
|
2651 * 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
|
2652 * @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
|
2653 * @ingroup Images |
1554
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2654 **/ |
1581
357c4bb15701
Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1580
diff
changeset
|
2655 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
|
2656 OrthancPluginContext* context, |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2657 OrthancPluginMemoryBuffer* target, |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2658 const void* source, |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2659 uint32_t size, |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2660 OrthancPluginCompressionType compression, |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2661 uint8_t uncompress) |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2662 { |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2663 _OrthancPluginBufferCompression params; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2664 params.target = target; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2665 params.source = source; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2666 params.size = size; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2667 params.compression = compression; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2668 params.uncompress = uncompress; |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2669 |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2670 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
|
2671 } |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2672 |
89ab71a68fcf
New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1466
diff
changeset
|
2673 |
1588
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2674 |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2675 typedef struct |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2676 { |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2677 OrthancPluginMemoryBuffer* target; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2678 const char* path; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2679 } _OrthancPluginReadFile; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2680 |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2681 /** |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2682 * @brief Read a file. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2683 * |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2684 * 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
|
2685 * a newly allocated memory buffer. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2686 * |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2687 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2688 * @param target The target memory buffer. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2689 * @param path The path of the file to be read. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2690 * @return 0 if success, or the error code if failure. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2691 **/ |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2692 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginReadFile( |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2693 OrthancPluginContext* context, |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2694 OrthancPluginMemoryBuffer* target, |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2695 const char* path) |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2696 { |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2697 _OrthancPluginReadFile params; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2698 params.target = target; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2699 params.path = path; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2700 return context->InvokeService(context, _OrthancPluginService_ReadFile, ¶ms); |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2701 } |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2702 |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2703 |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2704 |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2705 typedef struct |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2706 { |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2707 const char* path; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2708 const void* data; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2709 uint32_t size; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2710 } _OrthancPluginWriteFile; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2711 |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2712 /** |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2713 * @brief Write a file. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2714 * |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2715 * Write the content of a memory buffer to the filesystem. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2716 * |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2717 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2718 * @param path The path of the file to be written. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2719 * @param data The content of the memory buffer. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2720 * @param size The size of the memory buffer. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2721 * @return 0 if success, or the error code if failure. |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2722 **/ |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2723 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWriteFile( |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2724 OrthancPluginContext* context, |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2725 const char* path, |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2726 const void* data, |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2727 uint32_t size) |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2728 { |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2729 _OrthancPluginWriteFile params; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2730 params.path = path; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2731 params.data = data; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2732 params.size = size; |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2733 return context->InvokeService(context, _OrthancPluginService_WriteFile, ¶ms); |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2734 } |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2735 |
b5bc87a7212d
OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1583
diff
changeset
|
2736 |
1593
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2737 |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2738 typedef struct |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2739 { |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2740 const char** target; |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2741 OrthancPluginErrorCode error; |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2742 } _OrthancPluginGetErrorDescription; |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2743 |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2744 /** |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2745 * @brief Get the description of a given error code. |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2746 * |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2747 * This function returns the description of a given error code. |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2748 * |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2749 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
1595
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
2750 * @param error The error code of interest. |
1593
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2751 * @return The error description. This is a statically-allocated |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2752 * string, do not free it. |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2753 **/ |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2754 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetErrorDescription( |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2755 OrthancPluginContext* context, |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2756 OrthancPluginErrorCode error) |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2757 { |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2758 const char* result = NULL; |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2759 |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2760 _OrthancPluginGetErrorDescription params; |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2761 params.target = &result; |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2762 params.error = error; |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2763 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2764 if (context->InvokeService(context, _OrthancPluginService_GetErrorDescription, ¶ms) != OrthancPluginErrorCode_Success || |
1593
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2765 result == NULL) |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2766 { |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2767 return "Unknown error code"; |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2768 } |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2769 else |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2770 { |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2771 return result; |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2772 } |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2773 } |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2774 |
235d89817b89
OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1588
diff
changeset
|
2775 |
1594
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2776 |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2777 typedef struct |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2778 { |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2779 OrthancPluginRestOutput* output; |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2780 uint16_t status; |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2781 const char* body; |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2782 uint32_t bodySize; |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2783 } _OrthancPluginSendHttpStatus; |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2784 |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2785 /** |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2786 * @brief Send a HTTP status, with a custom body. |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2787 * |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2788 * This function answers to a HTTP request by sending a HTTP status |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2789 * code (such as "400 - Bad Request"), together with a body |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2790 * describing the error. The body will only be returned if the |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2791 * configuration option "HttpDescribeErrors" of Orthanc is set to "true". |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2792 * |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2793 * Note that: |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2794 * - Successful requests (status 200) must use ::OrthancPluginAnswerBuffer(). |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2795 * - Redirections (status 301) must use ::OrthancPluginRedirect(). |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2796 * - Unauthorized access (status 401) must use ::OrthancPluginSendUnauthorized(). |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2797 * - Methods not allowed (status 405) must use ::OrthancPluginSendMethodNotAllowed(). |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2798 * |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2799 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2800 * @param output The HTTP connection to the client application. |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2801 * @param status The HTTP status code to be sent. |
1595
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
2802 * @param body The body of the answer. |
e1e54a73ba8b
OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1594
diff
changeset
|
2803 * @param bodySize The size of the body. |
1594
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2804 * @see OrthancPluginSendHttpStatusCode() |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
2805 * @ingroup REST |
1594
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2806 **/ |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2807 ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatus( |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2808 OrthancPluginContext* context, |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2809 OrthancPluginRestOutput* output, |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2810 uint16_t status, |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2811 const char* body, |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2812 uint32_t bodySize) |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2813 { |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2814 _OrthancPluginSendHttpStatus params; |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2815 params.output = output; |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2816 params.status = status; |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2817 params.body = body; |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2818 params.bodySize = bodySize; |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2819 context->InvokeService(context, _OrthancPluginService_SendHttpStatus, ¶ms); |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2820 } |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2821 |
2bac60a4f584
OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1593
diff
changeset
|
2822 |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2823 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2824 typedef struct |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2825 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2826 const OrthancPluginImage* image; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2827 uint32_t* resultUint32; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2828 OrthancPluginPixelFormat* resultPixelFormat; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2829 const void** resultBuffer; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2830 } _OrthancPluginGetImageInfo; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2831 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2832 |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2833 /** |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2834 * @brief Return the pixel format of an image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2835 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2836 * 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
|
2837 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2838 * @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
|
2839 * @param image The image of interest. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2840 * @return The pixel format. |
1613
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
2841 * @ingroup Images |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2842 **/ |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2843 ORTHANC_PLUGIN_INLINE OrthancPluginPixelFormat OrthancPluginGetImagePixelFormat( |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2844 OrthancPluginContext* context, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2845 const OrthancPluginImage* image) |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2846 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2847 OrthancPluginPixelFormat target; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2848 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2849 _OrthancPluginGetImageInfo params; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2850 memset(¶ms, 0, sizeof(params)); |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2851 params.image = image; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2852 params.resultPixelFormat = ⌖ |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2853 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2854 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
|
2855 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2856 return OrthancPluginPixelFormat_Unknown; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2857 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2858 else |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2859 { |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2860 return (OrthancPluginPixelFormat) target; |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2861 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2862 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2863 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2864 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2865 |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2866 /** |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2867 * @brief Return the width of an image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2868 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2869 * This function returns the width of the given image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2870 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2871 * @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
|
2872 * @param image The image of interest. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2873 * @return The width. |
1613
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
2874 * @ingroup Images |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2875 **/ |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2876 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageWidth( |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2877 OrthancPluginContext* context, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2878 const OrthancPluginImage* image) |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2879 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2880 uint32_t width; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2881 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2882 _OrthancPluginGetImageInfo params; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2883 memset(¶ms, 0, sizeof(params)); |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2884 params.image = image; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2885 params.resultUint32 = &width; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2886 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2887 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
|
2888 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2889 return 0; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2890 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2891 else |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2892 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2893 return width; |
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 } |
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 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2898 |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2899 /** |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2900 * @brief Return the height of an image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2901 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2902 * This function returns the height of the given image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2903 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2904 * @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
|
2905 * @param image The image of interest. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2906 * @return The height. |
1613
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
2907 * @ingroup Images |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2908 **/ |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2909 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageHeight( |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2910 OrthancPluginContext* context, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2911 const OrthancPluginImage* image) |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2912 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2913 uint32_t height; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2914 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2915 _OrthancPluginGetImageInfo params; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2916 memset(¶ms, 0, sizeof(params)); |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2917 params.image = image; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2918 params.resultUint32 = &height; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2919 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2920 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
|
2921 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2922 return 0; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2923 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2924 else |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2925 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2926 return height; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2927 } |
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 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2930 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2931 |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2932 /** |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2933 * @brief Return the pitch of an image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2934 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2935 * 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
|
2936 * 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
|
2937 * image in the memory buffer. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2938 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2939 * @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
|
2940 * @param image The image of interest. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2941 * @return The pitch. |
1613
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
2942 * @ingroup Images |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2943 **/ |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2944 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImagePitch( |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2945 OrthancPluginContext* context, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2946 const OrthancPluginImage* image) |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2947 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2948 uint32_t pitch; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2949 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2950 _OrthancPluginGetImageInfo params; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2951 memset(¶ms, 0, sizeof(params)); |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2952 params.image = image; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2953 params.resultUint32 = &pitch; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2954 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2955 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
|
2956 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2957 return 0; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2958 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2959 else |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2960 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2961 return pitch; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2962 } |
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 |
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 |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2967 /** |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2968 * @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
|
2969 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2970 * 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
|
2971 * contains the pixels of the 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 * @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
|
2974 * @param image The image of interest. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2975 * @return The pointer. |
1613
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
2976 * @ingroup Images |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
2977 **/ |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2978 ORTHANC_PLUGIN_INLINE const void* OrthancPluginGetImageBuffer( |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2979 OrthancPluginContext* context, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2980 const OrthancPluginImage* image) |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2981 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2982 const void* target = NULL; |
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 _OrthancPluginGetImageInfo params; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2985 memset(¶ms, 0, sizeof(params)); |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2986 params.resultBuffer = ⌖ |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2987 params.image = image; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2988 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
2989 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
|
2990 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
2991 return NULL; |
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 else |
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 return target; |
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 } |
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 typedef struct |
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 OrthancPluginImage** target; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3003 const void* data; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3004 uint32_t size; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3005 OrthancPluginImageFormat format; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3006 } _OrthancPluginUncompressImage; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3007 |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3008 |
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 * @brief Decode a compressed image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3011 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3012 * 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
|
3013 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3014 * @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
|
3015 * @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
|
3016 * @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
|
3017 * @param format The file format of the compressed image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3018 * @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
|
3019 * @ingroup Images |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3020 **/ |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3021 ORTHANC_PLUGIN_INLINE OrthancPluginImage *OrthancPluginUncompressImage( |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3022 OrthancPluginContext* context, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3023 const void* data, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3024 uint32_t size, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3025 OrthancPluginImageFormat format) |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3026 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3027 OrthancPluginImage* target = NULL; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3028 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3029 _OrthancPluginUncompressImage params; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3030 memset(¶ms, 0, sizeof(params)); |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3031 params.target = ⌖ |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3032 params.data = data; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3033 params.size = size; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3034 params.format = format; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3035 |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
3036 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
|
3037 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3038 return NULL; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3039 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3040 else |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3041 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3042 return target; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3043 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3044 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3045 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3046 |
1605 | 3047 |
3048 | |
3049 typedef struct | |
3050 { | |
3051 OrthancPluginImage* image; | |
3052 } _OrthancPluginFreeImage; | |
3053 | |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3054 /** |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3055 * @brief Free an image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3056 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3057 * 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
|
3058 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3059 * @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
|
3060 * @param image The image. |
1613
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3061 * @ingroup Images |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3062 **/ |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3063 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeImage( |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3064 OrthancPluginContext* context, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3065 OrthancPluginImage* image) |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3066 { |
1605 | 3067 _OrthancPluginFreeImage params; |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3068 params.image = image; |
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 context->InvokeService(context, _OrthancPluginService_FreeImage, ¶ms); |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3071 } |
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 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3074 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3075 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3076 typedef struct |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3077 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3078 OrthancPluginMemoryBuffer* target; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3079 OrthancPluginImageFormat imageFormat; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3080 OrthancPluginPixelFormat pixelFormat; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3081 uint32_t width; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3082 uint32_t height; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3083 uint32_t pitch; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3084 const void* buffer; |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
3085 uint8_t quality; |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3086 } _OrthancPluginCompressImage; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3087 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3088 |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3089 /** |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
3090 * @brief Encode a PNG image. |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3091 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3092 * This function compresses the given memory buffer containing an |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3093 * 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
|
3094 * compression into a newly allocated memory buffer. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3095 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3096 * @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
|
3097 * @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
|
3098 * @param format The memory layout of the uncompressed image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3099 * @param width The width of the image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3100 * @param height The height of the image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3101 * @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
|
3102 * 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
|
3103 * @param buffer The memory buffer containing the uncompressed image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3104 * @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
|
3105 * @see OrthancPluginCompressAndAnswerPngImage() |
1613
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3106 * @ingroup Images |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3107 **/ |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3108 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCompressPngImage( |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3109 OrthancPluginContext* context, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3110 OrthancPluginMemoryBuffer* target, |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3111 OrthancPluginPixelFormat format, |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3112 uint32_t width, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3113 uint32_t height, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3114 uint32_t pitch, |
1599
dd1f9e81f891
fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
3115 const void* buffer) |
1598
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 _OrthancPluginCompressImage params; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3118 memset(¶ms, 0, sizeof(params)); |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3119 params.target = target; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3120 params.imageFormat = OrthancPluginImageFormat_Png; |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3121 params.pixelFormat = format; |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3122 params.width = width; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3123 params.height = height; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3124 params.pitch = pitch; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3125 params.buffer = buffer; |
1613
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3126 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
|
3127 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3128 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
|
3129 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3130 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3131 |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3132 /** |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
3133 * @brief Encode a JPEG image. |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3134 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3135 * This function compresses the given memory buffer containing an |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3136 * 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
|
3137 * compression into a newly allocated memory buffer. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3138 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3139 * @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
|
3140 * @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
|
3141 * @param format The memory layout of the uncompressed image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3142 * @param width The width of the image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3143 * @param height The height of the image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3144 * @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
|
3145 * 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
|
3146 * @param buffer The memory buffer containing the uncompressed image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3147 * @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
|
3148 * quality, best compression) and 100 (best quality, worst |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3149 * compression). |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3150 * @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
|
3151 * @ingroup Images |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3152 **/ |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3153 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCompressJpegImage( |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3154 OrthancPluginContext* context, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3155 OrthancPluginMemoryBuffer* target, |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3156 OrthancPluginPixelFormat format, |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3157 uint32_t width, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3158 uint32_t height, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3159 uint32_t pitch, |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3160 const void* buffer, |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3161 uint8_t quality) |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3162 { |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3163 _OrthancPluginCompressImage params; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3164 memset(¶ms, 0, sizeof(params)); |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3165 params.target = target; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3166 params.imageFormat = OrthancPluginImageFormat_Jpeg; |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3167 params.pixelFormat = format; |
1598
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3168 params.width = width; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3169 params.height = height; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3170 params.pitch = pitch; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3171 params.buffer = buffer; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3172 params.quality = quality; |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3173 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3174 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
|
3175 } |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3176 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3177 |
c6b50b803387
primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
3178 |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3179 /** |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3180 * @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
|
3181 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3182 * 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
|
3183 * parameters of this function describe a memory buffer that |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3184 * 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
|
3185 * 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
|
3186 * |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3187 * @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
|
3188 * @param output The HTTP connection to the client application. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3189 * @param format The memory layout of the uncompressed image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3190 * @param width The width of the image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3191 * @param height The height of the image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3192 * @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
|
3193 * 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
|
3194 * @param buffer The memory buffer containing the uncompressed image. |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3195 * @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
|
3196 * quality, best compression) and 100 (best quality, worst |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3197 * compression). |
1601
6cccf1da35c6
groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1600
diff
changeset
|
3198 * @ingroup REST |
1600
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3199 **/ |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3200 ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerJpegImage( |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3201 OrthancPluginContext* context, |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3202 OrthancPluginRestOutput* output, |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3203 OrthancPluginPixelFormat format, |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3204 uint32_t width, |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3205 uint32_t height, |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3206 uint32_t pitch, |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3207 const void* buffer, |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3208 uint8_t quality) |
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 _OrthancPluginCompressAndAnswerImage params; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3211 params.output = output; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3212 params.imageFormat = OrthancPluginImageFormat_Jpeg; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3213 params.pixelFormat = format; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3214 params.width = width; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3215 params.height = height; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3216 params.pitch = pitch; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3217 params.buffer = buffer; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3218 params.quality = quality; |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3219 context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, ¶ms); |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3220 } |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3221 |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3222 |
7151d63e6d81
documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1599
diff
changeset
|
3223 |
1606
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3224 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3225 typedef struct |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3226 { |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3227 OrthancPluginMemoryBuffer* target; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3228 OrthancPluginHttpMethod method; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3229 const char* url; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3230 const char* username; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3231 const char* password; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3232 const char* body; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3233 uint32_t bodySize; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3234 } _OrthancPluginCallHttpClient; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3235 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3236 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3237 /** |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3238 * @brief Issue a HTTP GET call. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3239 * |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3240 * 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
|
3241 * 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
|
3242 * 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
|
3243 * Orthanc instance that hosts this plugin. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3244 * |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3245 * @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
|
3246 * @param target The target memory buffer. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3247 * @param url The URL of interest. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3248 * @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
|
3249 * @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
|
3250 * @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
|
3251 **/ |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3252 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpGet( |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3253 OrthancPluginContext* context, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3254 OrthancPluginMemoryBuffer* target, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3255 const char* url, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3256 const char* username, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3257 const char* password) |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3258 { |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3259 _OrthancPluginCallHttpClient params; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3260 memset(¶ms, 0, sizeof(params)); |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3261 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3262 params.target = target; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3263 params.method = OrthancPluginHttpMethod_Get; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3264 params.url = url; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3265 params.username = username; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3266 params.password = password; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3267 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3268 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
|
3269 } |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3270 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3271 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3272 /** |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3273 * @brief Issue a HTTP POST call. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3274 * |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3275 * 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
|
3276 * 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
|
3277 * 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
|
3278 * 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
|
3279 * |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3280 * @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
|
3281 * @param target The target memory buffer. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3282 * @param url The URL of interest. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3283 * @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
|
3284 * @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
|
3285 * @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
|
3286 * @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
|
3287 * @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
|
3288 **/ |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3289 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpPost( |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3290 OrthancPluginContext* context, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3291 OrthancPluginMemoryBuffer* target, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3292 const char* url, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3293 const char* body, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3294 uint32_t bodySize, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3295 const char* username, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3296 const char* password) |
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 _OrthancPluginCallHttpClient params; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3299 memset(¶ms, 0, sizeof(params)); |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3300 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3301 params.target = target; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3302 params.method = OrthancPluginHttpMethod_Post; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3303 params.url = url; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3304 params.body = body; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3305 params.bodySize = bodySize; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3306 params.username = username; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3307 params.password = password; |
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 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
|
3310 } |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3311 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3312 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3313 /** |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3314 * @brief Issue a HTTP PUT call. |
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 * 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
|
3317 * 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
|
3318 * 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
|
3319 * Orthanc instance that hosts this plugin. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3320 * |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3321 * @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
|
3322 * @param target The target memory buffer. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3323 * @param url The URL of interest. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3324 * @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
|
3325 * @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
|
3326 * @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
|
3327 * @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
|
3328 * @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
|
3329 **/ |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3330 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpPut( |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3331 OrthancPluginContext* context, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3332 OrthancPluginMemoryBuffer* target, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3333 const char* url, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3334 const char* body, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3335 uint32_t bodySize, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3336 const char* username, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3337 const char* 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 _OrthancPluginCallHttpClient params; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3340 memset(¶ms, 0, sizeof(params)); |
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 params.target = target; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3343 params.method = OrthancPluginHttpMethod_Put; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3344 params.url = url; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3345 params.body = body; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3346 params.bodySize = bodySize; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3347 params.username = username; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3348 params.password = password; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3349 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3350 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
|
3351 } |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3352 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3353 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3354 /** |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3355 * @brief Issue a HTTP DELETE call. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3356 * |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3357 * 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
|
3358 * 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
|
3359 * 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
|
3360 * |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3361 * @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
|
3362 * @param url The URL of interest. |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3363 * @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
|
3364 * @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
|
3365 * @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
|
3366 **/ |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3367 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpDelete( |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3368 OrthancPluginContext* context, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3369 const char* url, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3370 const char* username, |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3371 const char* password) |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3372 { |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3373 _OrthancPluginCallHttpClient params; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3374 memset(¶ms, 0, sizeof(params)); |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3375 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3376 params.method = OrthancPluginHttpMethod_Delete; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3377 params.url = url; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3378 params.username = username; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3379 params.password = password; |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3380 |
31f4adefb88f
issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1605
diff
changeset
|
3381 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
|
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 |
1608
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3386 typedef struct |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3387 { |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3388 OrthancPluginImage** target; |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3389 const OrthancPluginImage* source; |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3390 OrthancPluginPixelFormat targetFormat; |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3391 } _OrthancPluginConvertPixelFormat; |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3392 |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3393 |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3394 /** |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3395 * @brief Change the pixel format of an image. |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3396 * |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3397 * 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
|
3398 * |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3399 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3400 * @param source The source image. |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3401 * @param targetFormat The target pixel format. |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3402 * @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
|
3403 * @ingroup Images |
1608
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3404 **/ |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3405 ORTHANC_PLUGIN_INLINE OrthancPluginImage *OrthancPluginConvertPixelFormat( |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3406 OrthancPluginContext* context, |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3407 const OrthancPluginImage* source, |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3408 OrthancPluginPixelFormat targetFormat) |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3409 { |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3410 OrthancPluginImage* target = NULL; |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3411 |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3412 _OrthancPluginConvertPixelFormat params; |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3413 params.target = ⌖ |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3414 params.source = source; |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3415 params.targetFormat = targetFormat; |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3416 |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3417 if (context->InvokeService(context, _OrthancPluginService_ConvertPixelFormat, ¶ms) != OrthancPluginErrorCode_Success) |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3418 { |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3419 return NULL; |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3420 } |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3421 else |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3422 { |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3423 return target; |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3424 } |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3425 } |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3426 |
adc6a5704cdb
OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1606
diff
changeset
|
3427 |
1613
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3428 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3429 /** |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3430 * @brief Return the number of available fonts. |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3431 * |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3432 * 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
|
3433 * 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
|
3434 * through OrthancPluginDrawText(). |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3435 * |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3436 * @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
|
3437 * @return The number of fonts. |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3438 * @ingroup Images |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3439 **/ |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3440 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontsCount( |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3441 OrthancPluginContext* context) |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3442 { |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3443 uint32_t count = 0; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3444 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3445 _OrthancPluginReturnSingleValue params; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3446 memset(¶ms, 0, sizeof(params)); |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3447 params.resultUint32 = &count; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3448 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3449 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
|
3450 { |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3451 /* Error */ |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3452 return 0; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3453 } |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3454 else |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3455 { |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3456 return count; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3457 } |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3458 } |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3459 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3460 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3461 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3462 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3463 typedef struct |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3464 { |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3465 uint32_t fontIndex; /* in */ |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3466 const char** name; /* out */ |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3467 uint32_t* size; /* out */ |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3468 } _OrthancPluginGetFontInfo; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3469 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3470 /** |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3471 * @brief Return the name of a font. |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3472 * |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3473 * 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
|
3474 * |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3475 * @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
|
3476 * @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
|
3477 * @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
|
3478 * @ingroup Images |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3479 **/ |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3480 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetFontName( |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3481 OrthancPluginContext* context, |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3482 uint32_t fontIndex) |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3483 { |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3484 const char* result = NULL; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3485 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3486 _OrthancPluginGetFontInfo params; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3487 memset(¶ms, 0, sizeof(params)); |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3488 params.name = &result; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3489 params.fontIndex = fontIndex; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3490 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3491 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
|
3492 { |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3493 return NULL; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3494 } |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3495 else |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3496 { |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3497 return result; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3498 } |
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 |
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 * @brief Return the size of a font. |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3504 * |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3505 * 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
|
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 * @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
|
3509 * @return The font size. |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3510 * @ingroup Images |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3511 **/ |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3512 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontSize( |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3513 OrthancPluginContext* context, |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3514 uint32_t fontIndex) |
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 uint32_t result; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3517 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3518 _OrthancPluginGetFontInfo params; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3519 memset(¶ms, 0, sizeof(params)); |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3520 params.size = &result; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3521 params.fontIndex = fontIndex; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3522 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3523 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
|
3524 { |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3525 return 0; |
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 else |
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 return result; |
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 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3535 typedef struct |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3536 { |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3537 OrthancPluginImage* image; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3538 uint32_t fontIndex; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3539 const char* utf8Text; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3540 int32_t x; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3541 int32_t y; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3542 uint8_t r; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3543 uint8_t g; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3544 uint8_t b; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3545 } _OrthancPluginDrawText; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3546 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3547 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3548 /** |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3549 * @brief Draw text on an image. |
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 * 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
|
3552 * |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3553 * @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
|
3554 * @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
|
3555 * @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
|
3556 * @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
|
3557 * @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
|
3558 * @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
|
3559 * @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
|
3560 * @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
|
3561 * @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
|
3562 * @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
|
3563 * @ingroup Images |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3564 **/ |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3565 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginDrawText( |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3566 OrthancPluginContext* context, |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3567 OrthancPluginImage* image, |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3568 uint32_t fontIndex, |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3569 const char* utf8Text, |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3570 int32_t x, |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3571 int32_t y, |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3572 uint8_t r, |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3573 uint8_t g, |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3574 uint8_t b) |
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 _OrthancPluginDrawText params; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3577 memset(¶ms, 0, sizeof(params)); |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3578 params.image = image; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3579 params.fontIndex = fontIndex; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3580 params.utf8Text = utf8Text; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3581 params.x = x; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3582 params.y = y; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3583 params.r = r; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3584 params.g = g; |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3585 params.b = b; |
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 return context->InvokeService(context, _OrthancPluginService_DrawText, ¶ms); |
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 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3590 |
1ec254a7c645
drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1610
diff
changeset
|
3591 |
1615
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3592 typedef struct |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3593 { |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3594 OrthancPluginStorageArea* storageArea; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3595 const char* uuid; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3596 const void* content; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3597 uint64_t size; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3598 OrthancPluginContentType type; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3599 } _OrthancPluginStorageAreaCreate; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3600 |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3601 |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3602 /** |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3603 * @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
|
3604 * |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3605 * 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
|
3606 * currently used by Orthanc. |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3607 * |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3608 * @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
|
3609 * @param storageArea The storage area. |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3610 * @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
|
3611 * @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
|
3612 * @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
|
3613 * @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
|
3614 * @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
|
3615 * @ingroup Callbacks |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3616 **/ |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3617 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaCreate( |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3618 OrthancPluginContext* context, |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3619 OrthancPluginStorageArea* storageArea, |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3620 const char* uuid, |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3621 const void* content, |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3622 uint64_t size, |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3623 OrthancPluginContentType type) |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3624 { |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3625 _OrthancPluginStorageAreaCreate params; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3626 params.storageArea = storageArea; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3627 params.uuid = uuid; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3628 params.content = content; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3629 params.size = size; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3630 params.type = type; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3631 |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3632 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
|
3633 } |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3634 |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3635 |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3636 typedef struct |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3637 { |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3638 OrthancPluginMemoryBuffer* target; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3639 OrthancPluginStorageArea* storageArea; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3640 const char* uuid; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3641 OrthancPluginContentType type; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3642 } _OrthancPluginStorageAreaRead; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3643 |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3644 |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3645 /** |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3646 * @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
|
3647 * |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3648 * 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
|
3649 * 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
|
3650 * |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3651 * @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
|
3652 * @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
|
3653 * @param storageArea The storage area. |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3654 * @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
|
3655 * @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
|
3656 * @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
|
3657 * @ingroup Callbacks |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3658 **/ |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3659 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaRead( |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3660 OrthancPluginContext* context, |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3661 OrthancPluginMemoryBuffer* target, |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3662 OrthancPluginStorageArea* storageArea, |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3663 const char* uuid, |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3664 OrthancPluginContentType type) |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3665 { |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3666 _OrthancPluginStorageAreaRead params; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3667 params.target = target; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3668 params.storageArea = storageArea; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3669 params.uuid = uuid; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3670 params.type = type; |
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 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
|
3673 } |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3674 |
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 typedef struct |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3677 { |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3678 OrthancPluginStorageArea* storageArea; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3679 const char* uuid; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3680 OrthancPluginContentType type; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3681 } _OrthancPluginStorageAreaRemove; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3682 |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3683 /** |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3684 * @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
|
3685 * |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3686 * 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
|
3687 * currently used by Orthanc. |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3688 * |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3689 * @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
|
3690 * @param storageArea The storage area. |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3691 * @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
|
3692 * @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
|
3693 * @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
|
3694 * @ingroup Callbacks |
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 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaRemove( |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3697 OrthancPluginContext* context, |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3698 OrthancPluginStorageArea* storageArea, |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3699 const char* uuid, |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3700 OrthancPluginContentType type) |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3701 { |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3702 _OrthancPluginStorageAreaRemove params; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3703 params.storageArea = storageArea; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3704 params.uuid = uuid; |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3705 params.type = type; |
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 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
|
3708 } |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3709 |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3710 |
c40fe92a68e7
Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1613
diff
changeset
|
3711 |
1649
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3712 typedef struct |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3713 { |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3714 OrthancPluginErrorCode* target; |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3715 int32_t code; |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3716 uint16_t httpStatus; |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3717 const char* message; |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3718 } _OrthancPluginRegisterErrorCode; |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3719 |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3720 /** |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3721 * @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
|
3722 * |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3723 * 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
|
3724 * 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
|
3725 * 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
|
3726 * HTTP status code. |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3727 * |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3728 * @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
|
3729 * @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
|
3730 * @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
|
3731 * @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
|
3732 * @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
|
3733 * @ingroup Toolbox |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3734 **/ |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3735 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterErrorCode( |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3736 OrthancPluginContext* context, |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3737 int32_t code, |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3738 uint16_t httpStatus, |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3739 const char* message) |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3740 { |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3741 OrthancPluginErrorCode target; |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3742 |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3743 _OrthancPluginRegisterErrorCode params; |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3744 params.target = ⌖ |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3745 params.code = code; |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3746 params.httpStatus = httpStatus; |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3747 params.message = message; |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3748 |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3749 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
|
3750 { |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3751 return target; |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3752 } |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3753 else |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3754 { |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3755 /* 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
|
3756 return OrthancPluginErrorCode_Plugin; |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3757 } |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3758 } |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3759 |
8040d56cb0b3
New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1643
diff
changeset
|
3760 |
1657
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3761 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3762 typedef struct |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3763 { |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3764 uint16_t group; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3765 uint16_t element; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3766 OrthancPluginValueRepresentation vr; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3767 const char* name; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3768 uint32_t minMultiplicity; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3769 uint32_t maxMultiplicity; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3770 } _OrthancPluginRegisterDictionaryTag; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3771 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3772 /** |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3773 * @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
|
3774 * |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3775 * This function declares a new tag in the dictionary of DICOM tags |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3776 * that is known to Orthanc. This function should be used in the |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3777 * OrthancPluginInitialize() callback. |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3778 * |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3779 * @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
|
3780 * @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
|
3781 * @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
|
3782 * @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
|
3783 * @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
|
3784 * @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
|
3785 * @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
|
3786 * an arbitrary multiplicity ("<tt>n</tt>"). |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3787 * @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
|
3788 * @ingroup Toolbox |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3789 **/ |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3790 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterDictionaryTag( |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3791 OrthancPluginContext* context, |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3792 uint16_t group, |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3793 uint16_t element, |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3794 OrthancPluginValueRepresentation vr, |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3795 const char* name, |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3796 uint32_t minMultiplicity, |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3797 uint32_t maxMultiplicity) |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3798 { |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3799 _OrthancPluginRegisterDictionaryTag params; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3800 params.group = group; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3801 params.element = element; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3802 params.vr = vr; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3803 params.name = name; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3804 params.minMultiplicity = minMultiplicity; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3805 params.maxMultiplicity = maxMultiplicity; |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3806 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3807 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
|
3808 } |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3809 |
5360cdba70d8
New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1649
diff
changeset
|
3810 |
1669
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3811 |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3812 |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3813 typedef struct |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3814 { |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3815 OrthancPluginStorageArea* storageArea; |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3816 OrthancPluginResourceType level; |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3817 } _OrthancPluginReconstructMainDicomTags; |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3818 |
1673
0bbcfd9695e5
UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1669
diff
changeset
|
3819 /** |
0bbcfd9695e5
UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1669
diff
changeset
|
3820 * @brief Reconstruct the main DICOM tags. |
0bbcfd9695e5
UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1669
diff
changeset
|
3821 * |
0bbcfd9695e5
UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1669
diff
changeset
|
3822 * 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
|
3823 * 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
|
3824 * 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
|
3825 * back-end |
0bbcfd9695e5
UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1669
diff
changeset
|
3826 * (cf. OrthancPlugins::IDatabaseBackend::UpgradeDatabase). A |
0bbcfd9695e5
UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1669
diff
changeset
|
3827 * database transaction will be automatically setup. |
0bbcfd9695e5
UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1669
diff
changeset
|
3828 * |
0bbcfd9695e5
UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1669
diff
changeset
|
3829 * @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
|
3830 * @param storageArea The storage area. |
0bbcfd9695e5
UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1669
diff
changeset
|
3831 * @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
|
3832 * @return 0 if success, other value if error. |
0bbcfd9695e5
UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1669
diff
changeset
|
3833 * @ingroup Callbacks |
0bbcfd9695e5
UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1669
diff
changeset
|
3834 **/ |
1669
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3835 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginReconstructMainDicomTags( |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3836 OrthancPluginContext* context, |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3837 OrthancPluginStorageArea* storageArea, |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3838 OrthancPluginResourceType level) |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3839 { |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3840 _OrthancPluginReconstructMainDicomTags params; |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3841 params.level = level; |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3842 params.storageArea = storageArea; |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3843 |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3844 return context->InvokeService(context, _OrthancPluginService_ReconstructMainDicomTags, ¶ms); |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3845 } |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3846 |
a412ad57f0f9
refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1657
diff
changeset
|
3847 |
1740
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3848 typedef struct |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3849 { |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3850 char** result; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3851 const char* instanceId; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3852 const char* buffer; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3853 uint32_t size; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3854 OrthancPluginDicomToJsonFormat format; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3855 OrthancPluginDicomToJsonFlags flags; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3856 uint32_t maxStringLength; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3857 } _OrthancPluginDicomToJson; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3858 |
1743 | 3859 |
3860 /** | |
3861 * @brief Format a DICOM memory buffer as a JSON string. | |
3862 * | |
3863 * This function takes as input a memory buffer containing a DICOM | |
3864 * file, and outputs a JSON string representing the tags of this | |
3865 * DICOM file. | |
3866 * | |
3867 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
3868 * @param buffer The memory buffer containing the DICOM file. | |
3869 * @param size The size of the memory buffer. | |
3870 * @param format The output format. | |
3871 * @param flags The output flags. | |
3872 * @param maxStringLength The maximum length of a field. Too long fields will | |
3873 * be output as "null". The 0 value means no maximum length. | |
3874 * @return The NULL value if the case of an error, or the JSON | |
3875 * string. This string must be freed by OrthancPluginFreeString(). | |
3876 * @ingroup Toolbox | |
3877 * @see OrthancPluginDicomInstanceToJson | |
3878 **/ | |
1740
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3879 ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomBufferToJson( |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3880 OrthancPluginContext* context, |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3881 const char* buffer, |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3882 uint32_t size, |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3883 OrthancPluginDicomToJsonFormat format, |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3884 OrthancPluginDicomToJsonFlags flags, |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3885 uint32_t maxStringLength) |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3886 { |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3887 char* result; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3888 |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3889 _OrthancPluginDicomToJson params; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3890 memset(¶ms, 0, sizeof(params)); |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3891 params.result = &result; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3892 params.buffer = buffer; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3893 params.size = size; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3894 params.format = format; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3895 params.flags = flags; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3896 params.maxStringLength = maxStringLength; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3897 |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3898 if (context->InvokeService(context, _OrthancPluginService_DicomBufferToJson, ¶ms) != OrthancPluginErrorCode_Success) |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3899 { |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3900 /* Error */ |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3901 return NULL; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3902 } |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3903 else |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3904 { |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3905 return result; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3906 } |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3907 } |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3908 |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3909 |
1743 | 3910 /** |
3911 * @brief Format a DICOM instance as a JSON string. | |
3912 * | |
3913 * This function formats a DICOM instance that is stored in Orthanc, | |
3914 * and outputs a JSON string representing the tags of this DICOM | |
3915 * instance. | |
3916 * | |
3917 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). | |
3918 * @param instanceId The Orthanc identifier of the instance. | |
3919 * @param format The output format. | |
3920 * @param flags The output flags. | |
3921 * @param maxStringLength The maximum length of a field. Too long fields will | |
3922 * be output as "null". The 0 value means no maximum length. | |
3923 * @return The NULL value if the case of an error, or the JSON | |
3924 * string. This string must be freed by OrthancPluginFreeString(). | |
3925 * @ingroup Toolbox | |
3926 * @see OrthancPluginDicomInstanceToJson | |
3927 **/ | |
1740
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3928 ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomInstanceToJson( |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3929 OrthancPluginContext* context, |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3930 const char* instanceId, |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3931 OrthancPluginDicomToJsonFormat format, |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3932 OrthancPluginDicomToJsonFlags flags, |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3933 uint32_t maxStringLength) |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3934 { |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3935 char* result; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3936 |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3937 _OrthancPluginDicomToJson params; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3938 memset(¶ms, 0, sizeof(params)); |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3939 params.result = &result; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3940 params.instanceId = instanceId; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3941 params.format = format; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3942 params.flags = flags; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3943 params.maxStringLength = maxStringLength; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3944 |
1741
06addfcd1d4c
OrthancStarted and OrthancStopped events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1740
diff
changeset
|
3945 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
|
3946 { |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3947 /* Error */ |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3948 return NULL; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3949 } |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3950 else |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3951 { |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3952 return result; |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3953 } |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3954 } |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3955 |
5e99a70b0635
DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1703
diff
changeset
|
3956 |
886 | 3957 #ifdef __cplusplus |
3958 } | |
3959 #endif | |
900 | 3960 |
3961 | |
3962 /** @} */ | |
3963 |