annotate Plugins/Include/orthanc/OrthancCPlugin.h @ 1821:580951a33583

OrthancPluginDicomFromJson
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 24 Nov 2015 17:46:32 +0100
parents 87c069c94ac9
children ac5b0b4e2434
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
4 * This C/C++ SDK allows external developers to create plugins that
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
5 * can be loaded into Orthanc to extend its functionality. Each
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
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
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
9 * -# <tt>int32_t OrthancPluginInitialize(const OrthancPluginContext* context)</tt>:
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
10 * This function is invoked by Orthanc when it loads the plugin on startup.
1041
2c49b7dffcec plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1040
diff changeset
11 * The plugin must:
2c49b7dffcec plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1040
diff changeset
12 * - Check its compatibility with the Orthanc version using
2c49b7dffcec plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1040
diff changeset
13 * ::OrthancPluginCheckVersion().
2c49b7dffcec plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1040
diff changeset
14 * - Store the context pointer so that it can use the plugin
2c49b7dffcec plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1040
diff changeset
15 * services of Orthanc.
2c49b7dffcec plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1040
diff changeset
16 * - Register all its REST callbacks using ::OrthancPluginRegisterRestCallback().
1466
0cd0f2ad3599 Fix potential deadlock in the callbacks of plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1430
diff changeset
17 * - Possibly register its callback for received DICOM instances using ::OrthancPluginRegisterOnStoredInstanceCallback().
0cd0f2ad3599 Fix potential deadlock in the callbacks of plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1430
diff changeset
18 * - Possibly register its callback for changes to the DICOM store using ::OrthancPluginRegisterOnChangeCallback().
1135
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
19 * - Possibly register a custom storage area using ::OrthancPluginRegisterStorageArea().
1609
c74495267acf Implementation of the "GetAllPublicIdsWithLimit" extension
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1608
diff changeset
20 * - Possibly register a custom database back-end area using OrthancPluginRegisterDatabaseBackendV2().
1803
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
21 * - Possibly register a handler for C-Find SCP against DICOM worklists using OrthancPluginRegisterWorklistCallback().
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
22 * -# <tt>void OrthancPluginFinalize()</tt>:
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
23 * This function is invoked by Orthanc during its shutdown. The plugin
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
24 * must free all its memory.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
25 * -# <tt>const char* OrthancPluginGetName()</tt>:
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
26 * The plugin must return a short string to identify itself.
1041
2c49b7dffcec plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1040
diff changeset
27 * -# <tt>const char* OrthancPluginGetVersion()</tt>:
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
28 * The plugin must return a string containing its version number.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
29 *
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
30 * The name and the version of a plugin is only used to prevent it
1602
292bce3f54ed JpegWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1601
diff changeset
31 * from being loaded twice. Note that, in C++, it is mandatory to
292bce3f54ed JpegWriter
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1601
diff changeset
32 * declare these functions within an <tt>extern "C"</tt> section.
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
33 *
1595
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
34 * To ensure multi-threading safety, the various REST callbacks are
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
35 * guaranteed to be executed in mutual exclusion since Orthanc
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
36 * 0.8.5. If this feature is undesired (notably when developing
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
37 * high-performance plugins handling simultaneous requests), use
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
38 * ::OrthancPluginRegisterRestCallbackNoLock().
906
cbc0ea03dffe sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 904
diff changeset
39 **/
cbc0ea03dffe sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 904
diff changeset
40
cbc0ea03dffe sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 904
diff changeset
41
cbc0ea03dffe sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 904
diff changeset
42
900
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
43 /**
1613
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
44 * @defgroup Images Images and compression
1601
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
45 * @brief Functions to deal with images and compressed buffers.
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
46 *
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
47 * @defgroup REST REST
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
48 * @brief Functions to answer REST requests in a callback.
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
49 *
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
50 * @defgroup Callbacks Callbacks
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
51 * @brief Functions to register and manage callbacks by the plugins.
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
52 *
1799
4f01c9d73f02 calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
53 * @defgroup Worklists Worklists
4f01c9d73f02 calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
54 * @brief Functions to register and manage worklists.
4f01c9d73f02 calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
55 *
1601
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
56 * @defgroup Orthanc Orthanc
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
57 * @brief Functions to access the content of the Orthanc server.
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
58 **/
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
59
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
60
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
61
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
62 /**
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
63 * @defgroup Toolbox Toolbox
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
64 * @brief Generic functions to help with the creation of plugins.
900
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
65 **/
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
66
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
67
906
cbc0ea03dffe sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 904
diff changeset
68
886
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 /**
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 * Orthanc - A Lightweight, RESTful DICOM Store
1288
6e7e5ed91c2d upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1282
diff changeset
71 * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics
6e7e5ed91c2d upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1282
diff changeset
72 * Department, University Hospital of Liege, Belgium
886
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 *
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 * This program is free software: you can redistribute it and/or
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 * modify it under the terms of the GNU General Public License as
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 * published by the Free Software Foundation, either version 3 of the
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 * License, or (at your option) any later version.
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 *
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 * In addition, as a special exception, the copyright holders of this
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 * program give permission to link the code of its release with the
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 * OpenSSL project's "OpenSSL" library (or with modified versions of it
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 * that use the same license as the "OpenSSL" library), and distribute
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 * the linked executables. You must obey the GNU General Public License
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 * in all respects for all of the code used other than "OpenSSL". If you
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 * modify file(s) with this exception, you may extend this exception to
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 * your version of the file(s), but you are not obligated to do so. If
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 * you do not wish to do so, delete this exception statement from your
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 * version. If you delete this exception statement from all source files
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 * in the program, then also delete it here.
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 *
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 * This program is distributed in the hope that it will be useful, but
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 * WITHOUT ANY WARRANTY; without even the implied warranty of
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 * General Public License for more details.
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 *
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 * You should have received a copy of the GNU General Public License
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 * along with this program. If not, see <http://www.gnu.org/licenses/>.
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 **/
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100
906
cbc0ea03dffe sample plugin configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 904
diff changeset
101
886
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 #pragma once
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104
900
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
105 #include <stdio.h>
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
106 #include <string.h>
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
107
886
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 #ifdef WIN32
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109 #define ORTHANC_PLUGINS_API __declspec(dllexport)
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 #else
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 #define ORTHANC_PLUGINS_API
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 #endif
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113
1039
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
114 #define ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER 0
1407
d371a66972a4 OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1322
diff changeset
115 #define ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER 9
1629
bad4772b605c OrthancPluginErrorCode in database plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1628
diff changeset
116 #define ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER 5
1039
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
117
886
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118
898
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
119
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
120 /********************************************************************
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
121 ** Check that function inlining is properly supported. The use of
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
122 ** inlining is required, to avoid the duplication of object code
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
123 ** between two compilation modules that would use the Orthanc Plugin
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
124 ** API.
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
125 ********************************************************************/
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
126
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
127 /* If the auto-detection of the "inline" keyword below does not work
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
128 automatically and that your compiler is known to properly support
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
129 inlining, uncomment the following #define and adapt the definition
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
130 of "static inline". */
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
131
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
132 /* #define ORTHANC_PLUGIN_INLINE static inline */
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
133
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
134 #ifndef ORTHANC_PLUGIN_INLINE
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
135 # if __STDC_VERSION__ >= 199901L
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
136 /* This is C99 or above: http://predef.sourceforge.net/prestd.html */
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
137 # define ORTHANC_PLUGIN_INLINE static inline
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
138 # elif defined(__cplusplus)
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
139 /* This is C++ */
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
140 # define ORTHANC_PLUGIN_INLINE static inline
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
141 # elif defined(__GNUC__)
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
142 /* This is GCC running in C89 mode */
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
143 # define ORTHANC_PLUGIN_INLINE static __inline
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
144 # elif defined(_MSC_VER)
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
145 /* This is Visual Studio running in C89 mode */
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
146 # define ORTHANC_PLUGIN_INLINE static __inline
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
147 # else
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
148 # error Your compiler is not known to support the "inline" keyword
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
149 # endif
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
150 #endif
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
151
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
152
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
153
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
154 /********************************************************************
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
155 ** Inclusion of standard libraries.
898
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
156 ********************************************************************/
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
157
1322
f497a72d9f71 fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1313
diff changeset
158 /**
f497a72d9f71 fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1313
diff changeset
159 * For Microsoft Visual Studio, a compatibility "stdint.h" can be
f497a72d9f71 fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1313
diff changeset
160 * downloaded at the following URL:
f497a72d9f71 fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1313
diff changeset
161 * https://orthanc.googlecode.com/hg/Resources/ThirdParty/VisualStudio/stdint.h
f497a72d9f71 fixes to the sample plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1313
diff changeset
162 **/
898
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
163 #include <stdint.h>
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
164
886
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 #include <stdlib.h>
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167
898
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
168
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
169 /********************************************************************
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
170 ** Definition of the Orthanc Plugin API.
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
171 ********************************************************************/
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
172
900
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
173 /** @{ */
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
174
886
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175 #ifdef __cplusplus
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
176 extern "C"
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177 {
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
178 #endif
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
179
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
180 /**
1578
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1554
diff changeset
181 * The various error codes that can be returned by the Orthanc core.
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1554
diff changeset
182 **/
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1554
diff changeset
183 typedef enum
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1554
diff changeset
184 {
1579
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
185 OrthancPluginErrorCode_InternalError = -1 /*!< Internal error */,
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
186 OrthancPluginErrorCode_Success = 0 /*!< Success */,
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
187 OrthancPluginErrorCode_Plugin = 1 /*!< Error encountered within the plugin engine */,
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
188 OrthancPluginErrorCode_NotImplemented = 2 /*!< Not implemented yet */,
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
189 OrthancPluginErrorCode_ParameterOutOfRange = 3 /*!< Parameter out of range */,
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
190 OrthancPluginErrorCode_NotEnoughMemory = 4 /*!< Not enough memory */,
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
191 OrthancPluginErrorCode_BadParameterType = 5 /*!< Bad type for a parameter */,
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
192 OrthancPluginErrorCode_BadSequenceOfCalls = 6 /*!< Bad sequence of calls */,
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
193 OrthancPluginErrorCode_InexistentItem = 7 /*!< Accessing an inexistent item */,
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
194 OrthancPluginErrorCode_BadRequest = 8 /*!< Bad request */,
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
195 OrthancPluginErrorCode_NetworkProtocol = 9 /*!< Error in the network protocol */,
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
196 OrthancPluginErrorCode_SystemCommand = 10 /*!< Error while calling a system command */,
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
197 OrthancPluginErrorCode_Database = 11 /*!< Error with the database engine */,
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
198 OrthancPluginErrorCode_UriSyntax = 12 /*!< Badly formatted URI */,
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
199 OrthancPluginErrorCode_InexistentFile = 13 /*!< Inexistent file */,
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
200 OrthancPluginErrorCode_CannotWriteFile = 14 /*!< Cannot write to file */,
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
201 OrthancPluginErrorCode_BadFileFormat = 15 /*!< Bad file format */,
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
202 OrthancPluginErrorCode_Timeout = 16 /*!< Timeout */,
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
203 OrthancPluginErrorCode_UnknownResource = 17 /*!< Unknown resource */,
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
204 OrthancPluginErrorCode_IncompatibleDatabaseVersion = 18 /*!< Incompatible version of the database */,
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
205 OrthancPluginErrorCode_FullStorage = 19 /*!< The file storage is full */,
1582
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
206 OrthancPluginErrorCode_CorruptedFile = 20 /*!< Corrupted file (e.g. inconsistent MD5 hash) */,
1579
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
207 OrthancPluginErrorCode_InexistentTag = 21 /*!< Inexistent tag */,
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
208 OrthancPluginErrorCode_ReadOnly = 22 /*!< Cannot modify a read-only data structure */,
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
209 OrthancPluginErrorCode_IncompatibleImageFormat = 23 /*!< Incompatible format of the images */,
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
210 OrthancPluginErrorCode_IncompatibleImageSize = 24 /*!< Incompatible size of the images */,
1580
bf502300c52e force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1579
diff changeset
211 OrthancPluginErrorCode_SharedLibrary = 25 /*!< Error while using a shared library (plugin) */,
1581
357c4bb15701 Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1580
diff changeset
212 OrthancPluginErrorCode_UnknownPluginService = 26 /*!< Plugin invoking an unknown service */,
1582
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
213 OrthancPluginErrorCode_UnknownDicomTag = 27 /*!< Unknown DICOM tag */,
1596
f2e3d030ea59 BadJson error code
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1595
diff changeset
214 OrthancPluginErrorCode_BadJson = 28 /*!< Cannot parse a JSON document */,
1606
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
215 OrthancPluginErrorCode_Unauthorized = 29 /*!< Bad credentials were provided to an HTTP request */,
1610
2dff2bdffdb8 font support within Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1609
diff changeset
216 OrthancPluginErrorCode_BadFont = 30 /*!< Badly formatted font file */,
1643
87c77b9b3679 provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1642
diff changeset
217 OrthancPluginErrorCode_DatabasePlugin = 31 /*!< The plugin implementing a custom database back-end does not fulfill the proper interface */,
87c77b9b3679 provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1642
diff changeset
218 OrthancPluginErrorCode_StorageAreaPlugin = 32 /*!< Error in the plugin implementing a custom storage area */,
1746
d143db00a794 SetOfResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1743
diff changeset
219 OrthancPluginErrorCode_EmptyRequest = 33 /*!< The request is empty */,
1781
5ad4e4d92ecb AcceptMediaDispatcher bootstrap
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1780
diff changeset
220 OrthancPluginErrorCode_NotAcceptable = 34 /*!< Cannot send a response which is acceptable according to the Accept HTTP header */,
1582
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
221 OrthancPluginErrorCode_SQLiteNotOpened = 1000 /*!< SQLite: The database is not opened */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
222 OrthancPluginErrorCode_SQLiteAlreadyOpened = 1001 /*!< SQLite: Connection is already open */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
223 OrthancPluginErrorCode_SQLiteCannotOpen = 1002 /*!< SQLite: Unable to open the database */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
224 OrthancPluginErrorCode_SQLiteStatementAlreadyUsed = 1003 /*!< SQLite: This cached statement is already being referred to */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
225 OrthancPluginErrorCode_SQLiteExecute = 1004 /*!< SQLite: Cannot execute a command */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
226 OrthancPluginErrorCode_SQLiteRollbackWithoutTransaction = 1005 /*!< SQLite: Rolling back a nonexistent transaction (have you called Begin()?) */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
227 OrthancPluginErrorCode_SQLiteCommitWithoutTransaction = 1006 /*!< SQLite: Committing a nonexistent transaction */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
228 OrthancPluginErrorCode_SQLiteRegisterFunction = 1007 /*!< SQLite: Unable to register a function */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
229 OrthancPluginErrorCode_SQLiteFlush = 1008 /*!< SQLite: Unable to flush the database */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
230 OrthancPluginErrorCode_SQLiteCannotRun = 1009 /*!< SQLite: Cannot run a cached statement */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
231 OrthancPluginErrorCode_SQLiteCannotStep = 1010 /*!< SQLite: Cannot step over a cached statement */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
232 OrthancPluginErrorCode_SQLiteBindOutOfRange = 1011 /*!< SQLite: Bing a value while out of range (serious error) */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
233 OrthancPluginErrorCode_SQLitePrepareStatement = 1012 /*!< SQLite: Cannot prepare a cached statement */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
234 OrthancPluginErrorCode_SQLiteTransactionAlreadyStarted = 1013 /*!< SQLite: Beginning the same transaction twice */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
235 OrthancPluginErrorCode_SQLiteTransactionCommit = 1014 /*!< SQLite: Failure when committing the transaction */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
236 OrthancPluginErrorCode_SQLiteTransactionBegin = 1015 /*!< SQLite: Cannot start a transaction */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
237 OrthancPluginErrorCode_DirectoryOverFile = 2000 /*!< The directory to be created is already occupied by a regular file */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
238 OrthancPluginErrorCode_FileStorageCannotWrite = 2001 /*!< Unable to create a subdirectory or a file in the file storage */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
239 OrthancPluginErrorCode_DirectoryExpected = 2002 /*!< The specified path does not point to a directory */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
240 OrthancPluginErrorCode_HttpPortInUse = 2003 /*!< The TCP port of the HTTP server is already in use */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
241 OrthancPluginErrorCode_DicomPortInUse = 2004 /*!< The TCP port of the DICOM server is already in use */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
242 OrthancPluginErrorCode_BadHttpStatusInRest = 2005 /*!< This HTTP status is not allowed in a REST API */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
243 OrthancPluginErrorCode_RegularFileExpected = 2006 /*!< The specified path does not point to a regular file */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
244 OrthancPluginErrorCode_PathToExecutable = 2007 /*!< Unable to get the path to the executable */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
245 OrthancPluginErrorCode_MakeDirectory = 2008 /*!< Cannot create a directory */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
246 OrthancPluginErrorCode_BadApplicationEntityTitle = 2009 /*!< An application entity title (AET) cannot be empty or be longer than 16 characters */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
247 OrthancPluginErrorCode_NoCFindHandler = 2010 /*!< No request handler factory for DICOM C-FIND SCP */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
248 OrthancPluginErrorCode_NoCMoveHandler = 2011 /*!< No request handler factory for DICOM C-MOVE SCP */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
249 OrthancPluginErrorCode_NoCStoreHandler = 2012 /*!< No request handler factory for DICOM C-STORE SCP */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
250 OrthancPluginErrorCode_NoApplicationEntityFilter = 2013 /*!< No application entity filter */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
251 OrthancPluginErrorCode_NoSopClassOrInstance = 2014 /*!< DicomUserConnection: Unable to find the SOP class and instance */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
252 OrthancPluginErrorCode_NoPresentationContext = 2015 /*!< DicomUserConnection: No acceptable presentation context for modality */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
253 OrthancPluginErrorCode_DicomFindUnavailable = 2016 /*!< DicomUserConnection: The C-FIND command is not supported by the remote SCP */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
254 OrthancPluginErrorCode_DicomMoveUnavailable = 2017 /*!< DicomUserConnection: The C-MOVE command is not supported by the remote SCP */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
255 OrthancPluginErrorCode_CannotStoreInstance = 2018 /*!< Cannot store an instance */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
256 OrthancPluginErrorCode_CreateDicomNotString = 2019 /*!< Only string values are supported when creating DICOM instances */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
257 OrthancPluginErrorCode_CreateDicomOverrideTag = 2020 /*!< Trying to override a value inherited from a parent module */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
258 OrthancPluginErrorCode_CreateDicomUseContent = 2021 /*!< Use \"Content\" to inject an image into a new DICOM instance */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
259 OrthancPluginErrorCode_CreateDicomNoPayload = 2022 /*!< No payload is present for one instance in the series */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
260 OrthancPluginErrorCode_CreateDicomUseDataUriScheme = 2023 /*!< The payload of the DICOM instance must be specified according to Data URI scheme */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
261 OrthancPluginErrorCode_CreateDicomBadParent = 2024 /*!< Trying to attach a new DICOM instance to an inexistent resource */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
262 OrthancPluginErrorCode_CreateDicomParentIsInstance = 2025 /*!< Trying to attach a new DICOM instance to an instance (must be a series, study or patient) */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
263 OrthancPluginErrorCode_CreateDicomParentEncoding = 2026 /*!< Unable to get the encoding of the parent resource */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
264 OrthancPluginErrorCode_UnknownModality = 2027 /*!< Unknown modality */,
bd1889029cbb encoding of exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1581
diff changeset
265 OrthancPluginErrorCode_BadJobOrdering = 2028 /*!< Bad ordering of filters in a job */,
1583
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
266 OrthancPluginErrorCode_JsonToLuaTable = 2029 /*!< Cannot convert the given JSON object to a Lua table */,
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
267 OrthancPluginErrorCode_CannotCreateLua = 2030 /*!< Cannot create the Lua context */,
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
268 OrthancPluginErrorCode_CannotExecuteLua = 2031 /*!< Cannot execute a Lua command */,
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
269 OrthancPluginErrorCode_LuaAlreadyExecuted = 2032 /*!< Arguments cannot be pushed after the Lua function is executed */,
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
270 OrthancPluginErrorCode_LuaBadOutput = 2033 /*!< The Lua function does not give the expected number of outputs */,
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
271 OrthancPluginErrorCode_NotLuaPredicate = 2034 /*!< The Lua function is not a predicate (only true/false outputs allowed) */,
9ea3d082b064 got rid of custom exceptions
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1582
diff changeset
272 OrthancPluginErrorCode_LuaReturnsNoString = 2035 /*!< The Lua function does not return a string */,
1630
ffd23c0104af "/system" URI gives information about the plugins used for storage area and DB back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1629
diff changeset
273 OrthancPluginErrorCode_StorageAreaAlreadyRegistered = 2036 /*!< Another plugin has already registered a custom storage area */,
ffd23c0104af "/system" URI gives information about the plugins used for storage area and DB back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1629
diff changeset
274 OrthancPluginErrorCode_DatabaseBackendAlreadyRegistered = 2037 /*!< Another plugin has already registered a custom database back-end */,
1643
87c77b9b3679 provision for error codes in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1642
diff changeset
275 OrthancPluginErrorCode_DatabaseNotInitialized = 2038 /*!< Plugin trying to call the database during its initialization */,
1674
4fc502d469f4 fix build if SSL is disabled
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1673
diff changeset
276 OrthancPluginErrorCode_SslDisabled = 2039 /*!< Orthanc has been built without SSL support */,
1703
b80e76dd1d56 ordered-slices continued
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1674
diff changeset
277 OrthancPluginErrorCode_CannotOrderSlices = 2040 /*!< Unable to order the slices of the series */,
1786
164d78911382 primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1781
diff changeset
278 OrthancPluginErrorCode_NoWorklistHandler = 2041 /*!< No request handler factory for DICOM C-Find Modality SCP */,
1580
bf502300c52e force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1579
diff changeset
279
bf502300c52e force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1579
diff changeset
280 _OrthancPluginErrorCode_INTERNAL = 0x7fffffff
1578
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1554
diff changeset
281 } OrthancPluginErrorCode;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1554
diff changeset
282
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1554
diff changeset
283
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1554
diff changeset
284 /**
1232
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
285 * Forward declaration of one of the mandatory functions for Orthanc
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
286 * plugins.
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
287 **/
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
288 ORTHANC_PLUGINS_API const char* OrthancPluginGetName();
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
289
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
290
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
291 /**
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
292 * The various HTTP methods for a REST call.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
293 **/
894
690aeb4cb899 REST callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 888
diff changeset
294 typedef enum
690aeb4cb899 REST callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 888
diff changeset
295 {
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
296 OrthancPluginHttpMethod_Get = 1, /*!< GET request */
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
297 OrthancPluginHttpMethod_Post = 2, /*!< POST request */
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
298 OrthancPluginHttpMethod_Put = 3, /*!< PUT request */
1580
bf502300c52e force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1579
diff changeset
299 OrthancPluginHttpMethod_Delete = 4, /*!< DELETE request */
bf502300c52e force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1579
diff changeset
300
bf502300c52e force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1579
diff changeset
301 _OrthancPluginHttpMethod_INTERNAL = 0x7fffffff
896
c4053ac5db04 better plugni api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 894
diff changeset
302 } OrthancPluginHttpMethod;
886
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
303
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
304
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
305 /**
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
306 * @brief The parameters of a REST request.
1601
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
307 * @ingroup Callbacks
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
308 **/
899
bb0a51561016 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 898
diff changeset
309 typedef struct
bb0a51561016 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 898
diff changeset
310 {
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
311 /**
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
312 * @brief The HTTP method.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
313 **/
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
314 OrthancPluginHttpMethod method;
899
bb0a51561016 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 898
diff changeset
315
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
316 /**
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
317 * @brief The number of groups of the regular expression.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
318 **/
904
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
319 uint32_t groupsCount;
901
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
320
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
321 /**
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
322 * @brief The matched values for the groups of the regular expression.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
323 **/
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
324 const char* const* groups;
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
325
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
326 /**
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
327 * @brief For a GET request, the number of GET parameters.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
328 **/
899
bb0a51561016 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 898
diff changeset
329 uint32_t getCount;
bb0a51561016 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 898
diff changeset
330
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
331 /**
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
332 * @brief For a GET request, the keys of the GET parameters.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
333 **/
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
334 const char* const* getKeys;
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
335
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
336 /**
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
337 * @brief For a GET request, the values of the GET parameters.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
338 **/
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
339 const char* const* getValues;
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
340
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
341 /**
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
342 * @brief For a PUT or POST request, the content of the body.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
343 **/
899
bb0a51561016 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 898
diff changeset
344 const char* body;
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
345
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
346 /**
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
347 * @brief For a PUT or POST request, the number of bytes of the body.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
348 **/
899
bb0a51561016 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 898
diff changeset
349 uint32_t bodySize;
1041
2c49b7dffcec plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1040
diff changeset
350
2c49b7dffcec plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1040
diff changeset
351
2c49b7dffcec plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1040
diff changeset
352 /* --------------------------------------------------
2c49b7dffcec plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1040
diff changeset
353 New in version 0.8.1
2c49b7dffcec plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1040
diff changeset
354 -------------------------------------------------- */
2c49b7dffcec plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1040
diff changeset
355
2c49b7dffcec plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1040
diff changeset
356 /**
2c49b7dffcec plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1040
diff changeset
357 * @brief The number of HTTP headers.
2c49b7dffcec plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1040
diff changeset
358 **/
2c49b7dffcec plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1040
diff changeset
359 uint32_t headersCount;
2c49b7dffcec plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1040
diff changeset
360
2c49b7dffcec plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1040
diff changeset
361 /**
2c49b7dffcec plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1040
diff changeset
362 * @brief The keys of the HTTP headers (always converted to low-case).
2c49b7dffcec plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1040
diff changeset
363 **/
2c49b7dffcec plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1040
diff changeset
364 const char* const* headersKeys;
2c49b7dffcec plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1040
diff changeset
365
2c49b7dffcec plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1040
diff changeset
366 /**
2c49b7dffcec plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1040
diff changeset
367 * @brief The values of the HTTP headers.
2c49b7dffcec plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1040
diff changeset
368 **/
2c49b7dffcec plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1040
diff changeset
369 const char* const* headersValues;
2c49b7dffcec plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1040
diff changeset
370
899
bb0a51561016 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 898
diff changeset
371 } OrthancPluginHttpRequest;
bb0a51561016 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 898
diff changeset
372
1041
2c49b7dffcec plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1040
diff changeset
373
900
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
374 typedef enum
886
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
375 {
900
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
376 /* Generic services */
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
377 _OrthancPluginService_LogInfo = 1,
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
378 _OrthancPluginService_LogWarning = 2,
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
379 _OrthancPluginService_LogError = 3,
1145
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
380 _OrthancPluginService_GetOrthancPath = 4,
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
381 _OrthancPluginService_GetOrthancDirectory = 5,
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
382 _OrthancPluginService_GetConfigurationPath = 6,
1249
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
383 _OrthancPluginService_SetPluginProperty = 7,
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
384 _OrthancPluginService_GetGlobalProperty = 8,
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
385 _OrthancPluginService_SetGlobalProperty = 9,
1280
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
386 _OrthancPluginService_GetCommandLineArgumentsCount = 10,
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
387 _OrthancPluginService_GetCommandLineArgument = 11,
1407
d371a66972a4 OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1322
diff changeset
388 _OrthancPluginService_GetExpectedDatabaseVersion = 12,
1424
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
389 _OrthancPluginService_GetConfiguration = 13,
1554
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
390 _OrthancPluginService_BufferCompression = 14,
1588
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
391 _OrthancPluginService_ReadFile = 15,
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
392 _OrthancPluginService_WriteFile = 16,
1593
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
393 _OrthancPluginService_GetErrorDescription = 17,
1606
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
394 _OrthancPluginService_CallHttpClient = 18,
1649
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
395 _OrthancPluginService_RegisterErrorCode = 19,
1657
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
396 _OrthancPluginService_RegisterDictionaryTag = 20,
1740
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
397 _OrthancPluginService_DicomBufferToJson = 21,
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
398 _OrthancPluginService_DicomInstanceToJson = 22,
1821
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
399 _OrthancPluginService_DicomFromJson = 23,
900
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
400
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
401 /* Registration of callbacks */
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
402 _OrthancPluginService_RegisterRestCallback = 1000,
1066
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
403 _OrthancPluginService_RegisterOnStoredInstanceCallback = 1001,
1135
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
404 _OrthancPluginService_RegisterStorageArea = 1002,
1177
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
405 _OrthancPluginService_RegisterOnChangeCallback = 1003,
1595
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
406 _OrthancPluginService_RegisterRestCallbackNoLock = 1004,
1800
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
407 _OrthancPluginService_RegisterWorklistCallback = 1005,
900
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
408
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
409 /* Sending answers to REST calls */
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
410 _OrthancPluginService_AnswerBuffer = 2000,
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
411 _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
412 _OrthancPluginService_Redirect = 2002,
1042
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
413 _OrthancPluginService_SendHttpStatusCode = 2003,
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
414 _OrthancPluginService_SendUnauthorized = 2004,
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
415 _OrthancPluginService_SendMethodNotAllowed = 2005,
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
416 _OrthancPluginService_SetCookie = 2006,
1137
d9c27f9f1a51 OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1136
diff changeset
417 _OrthancPluginService_SetHttpHeader = 2007,
1430
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
418 _OrthancPluginService_StartMultipartAnswer = 2008,
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
419 _OrthancPluginService_SendMultipartItem = 2009,
1593
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
420 _OrthancPluginService_SendHttpStatus = 2010,
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
421 _OrthancPluginService_CompressAndAnswerImage = 2011,
904
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
422
912
dcb2469f00f4 PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 908
diff changeset
423 /* Access to the Orthanc database and API */
dcb2469f00f4 PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 908
diff changeset
424 _OrthancPluginService_GetDicomForInstance = 3000,
dcb2469f00f4 PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 908
diff changeset
425 _OrthancPluginService_RestApiGet = 3001,
dcb2469f00f4 PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 908
diff changeset
426 _OrthancPluginService_RestApiPost = 3002,
dcb2469f00f4 PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 908
diff changeset
427 _OrthancPluginService_RestApiDelete = 3003,
1037
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
428 _OrthancPluginService_RestApiPut = 3004,
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
429 _OrthancPluginService_LookupPatient = 3005,
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
430 _OrthancPluginService_LookupStudy = 3006,
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
431 _OrthancPluginService_LookupSeries = 3007,
1066
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
432 _OrthancPluginService_LookupInstance = 3008,
1069
a91b4900f06a plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1068
diff changeset
433 _OrthancPluginService_LookupStudyWithAccessionNumber = 3009,
1282
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
434 _OrthancPluginService_RestApiGetAfterPlugins = 3010,
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
435 _OrthancPluginService_RestApiPostAfterPlugins = 3011,
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
436 _OrthancPluginService_RestApiDeleteAfterPlugins = 3012,
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
437 _OrthancPluginService_RestApiPutAfterPlugins = 3013,
1669
a412ad57f0f9 refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1657
diff changeset
438 _OrthancPluginService_ReconstructMainDicomTags = 3014,
1780
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
439 _OrthancPluginService_RestApiGet2 = 3015,
1066
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
440
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
441 /* Access to DICOM instances */
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
442 _OrthancPluginService_GetInstanceRemoteAet = 4000,
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
443 _OrthancPluginService_GetInstanceSize = 4001,
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
444 _OrthancPluginService_GetInstanceData = 4002,
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
445 _OrthancPluginService_GetInstanceJson = 4003,
1067
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
446 _OrthancPluginService_GetInstanceSimplifiedJson = 4004,
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
447 _OrthancPluginService_HasInstanceMetadata = 4005,
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1303
diff changeset
448 _OrthancPluginService_GetInstanceMetadata = 4006,
1815
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
449 _OrthancPluginService_GetInstanceOrigin = 4007,
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1303
diff changeset
450
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1303
diff changeset
451 /* 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
452 _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
453 _OrthancPluginService_DatabaseAnswer = 5001,
1609
c74495267acf Implementation of the "GetAllPublicIdsWithLimit" extension
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1608
diff changeset
454 _OrthancPluginService_RegisterDatabaseBackendV2 = 5002,
1615
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
455 _OrthancPluginService_StorageAreaCreate = 5003,
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
456 _OrthancPluginService_StorageAreaRead = 5004,
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
457 _OrthancPluginService_StorageAreaRemove = 5005,
1309
8f4487d8f79e new files for custom database back-end
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1303
diff changeset
458
1598
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
459 /* Primitives for handling images */
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
460 _OrthancPluginService_GetImagePixelFormat = 6000,
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
461 _OrthancPluginService_GetImageWidth = 6001,
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
462 _OrthancPluginService_GetImageHeight = 6002,
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
463 _OrthancPluginService_GetImagePitch = 6003,
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
464 _OrthancPluginService_GetImageBuffer = 6004,
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
465 _OrthancPluginService_UncompressImage = 6005,
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
466 _OrthancPluginService_FreeImage = 6006,
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
467 _OrthancPluginService_CompressImage = 6007,
1608
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
468 _OrthancPluginService_ConvertPixelFormat = 6008,
1613
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
469 _OrthancPluginService_GetFontsCount = 6009,
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
470 _OrthancPluginService_GetFontInfo = 6010,
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
471 _OrthancPluginService_DrawText = 6011,
1598
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
472
1800
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
473 /* Primitives for handling worklists */
1810
796d0b087fb8 more consistent naming in worklist primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1803
diff changeset
474 _OrthancPluginService_WorklistAddAnswer = 7000,
796d0b087fb8 more consistent naming in worklist primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1803
diff changeset
475 _OrthancPluginService_WorklistMarkIncomplete = 7001,
796d0b087fb8 more consistent naming in worklist primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1803
diff changeset
476 _OrthancPluginService_WorklistIsMatch = 7002,
796d0b087fb8 more consistent naming in worklist primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1803
diff changeset
477 _OrthancPluginService_WorklistGetDicomQuery = 7003,
1800
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
478
1580
bf502300c52e force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1579
diff changeset
479 _OrthancPluginService_INTERNAL = 0x7fffffff
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
480 } _OrthancPluginService;
900
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
481
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
482
1232
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
483 typedef enum
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
484 {
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
485 _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
486 _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
487 _OrthancPluginProperty_OrthancExplorer = 3,
bf502300c52e force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1579
diff changeset
488
bf502300c52e force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1579
diff changeset
489 _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
490 } _OrthancPluginProperty;
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
491
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
492
900
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
493
901
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
494 /**
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
495 * 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
496 * @ingroup Images
901
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
497 **/
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
498 typedef enum
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 /**
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
501 * @brief Graylevel 8bpp image.
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
502 *
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
503 * 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
504 * one byte.
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
505 **/
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
506 OrthancPluginPixelFormat_Grayscale8 = 1,
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 /**
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
509 * @brief Graylevel, unsigned 16bpp image.
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
510 *
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
511 * 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
512 * two bytes.
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
513 **/
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
514 OrthancPluginPixelFormat_Grayscale16 = 2,
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 /**
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
517 * @brief Graylevel, signed 16bpp image.
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
518 *
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
519 * 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
520 * bytes.
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
521 **/
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
522 OrthancPluginPixelFormat_SignedGrayscale16 = 3,
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
523
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
524 /**
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
525 * @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
526 *
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
527 * 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
528 * 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
529 **/
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
530 OrthancPluginPixelFormat_RGB24 = 4,
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
531
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
532 /**
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
533 * @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
534 *
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
535 * 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
536 * 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
537 **/
1580
bf502300c52e force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1579
diff changeset
538 OrthancPluginPixelFormat_RGBA32 = 5,
bf502300c52e force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1579
diff changeset
539
1598
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
540 OrthancPluginPixelFormat_Unknown = 6, /*!< Unknown pixel format */
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
541
1580
bf502300c52e force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1579
diff changeset
542 _OrthancPluginPixelFormat_INTERNAL = 0x7fffffff
901
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
543 } OrthancPluginPixelFormat;
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
544
894
690aeb4cb899 REST callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 888
diff changeset
545
1135
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
546
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
547 /**
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
548 * 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
549 **/
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
550 typedef enum
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
551 {
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
552 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
553 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
554 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
555
bf502300c52e force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1579
diff changeset
556 _OrthancPluginContentType_INTERNAL = 0x7fffffff
1135
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
557 } OrthancPluginContentType;
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
558
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
559
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
560
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
561 /**
1554
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
562 * The supported types of DICOM resources.
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 {
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
566 OrthancPluginResourceType_Patient = 0, /*!< Patient */
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
567 OrthancPluginResourceType_Study = 1, /*!< Study */
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
568 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
569 OrthancPluginResourceType_Instance = 3, /*!< Instance */
1741
06addfcd1d4c OrthancStarted and OrthancStopped events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1740
diff changeset
570 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
571
bf502300c52e force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1579
diff changeset
572 _OrthancPluginResourceType_INTERNAL = 0x7fffffff
1177
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
573 } OrthancPluginResourceType;
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
574
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
575
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
576
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
577 /**
1554
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
578 * 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
579 * @ingroup Callbacks
1177
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
580 **/
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
581 typedef enum
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
582 {
1198
1169528a9a5f refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1189
diff changeset
583 OrthancPluginChangeType_CompletedSeries = 0, /*!< Series is now complete */
1169528a9a5f refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1189
diff changeset
584 OrthancPluginChangeType_Deleted = 1, /*!< Deleted resource */
1169528a9a5f refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1189
diff changeset
585 OrthancPluginChangeType_NewChildInstance = 2, /*!< A new instance was added to this resource */
1169528a9a5f refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1189
diff changeset
586 OrthancPluginChangeType_NewInstance = 3, /*!< New instance received */
1169528a9a5f refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1189
diff changeset
587 OrthancPluginChangeType_NewPatient = 4, /*!< New patient created */
1169528a9a5f refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1189
diff changeset
588 OrthancPluginChangeType_NewSeries = 5, /*!< New series created */
1169528a9a5f refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1189
diff changeset
589 OrthancPluginChangeType_NewStudy = 6, /*!< New study created */
1169528a9a5f refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1189
diff changeset
590 OrthancPluginChangeType_StablePatient = 7, /*!< Timeout: No new instance in this patient */
1169528a9a5f refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1189
diff changeset
591 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
592 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
593 OrthancPluginChangeType_OrthancStarted = 10, /*!< Orthanc has started */
06addfcd1d4c OrthancStarted and OrthancStopped events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1740
diff changeset
594 OrthancPluginChangeType_OrthancStopped = 11, /*!< Orthanc is stopping */
1773
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1765
diff changeset
595 OrthancPluginChangeType_UpdatedAttachment = 12, /*!< Some user-defined attachment has changed for this resource */
613df4362575 New UpdatedAttachment and UpdatedMetadata events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1765
diff changeset
596 OrthancPluginChangeType_UpdatedMetadata = 13, /*!< Some user-defined metadata has changed for this resource */
1580
bf502300c52e force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1579
diff changeset
597
bf502300c52e force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1579
diff changeset
598 _OrthancPluginChangeType_INTERNAL = 0x7fffffff
1177
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
599 } OrthancPluginChangeType;
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
600
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
601
1554
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
602 /**
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
603 * 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
604 * @ingroup Images
1554
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
605 **/
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
606 typedef enum
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
607 {
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
608 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
609 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
610 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
611 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
612
bf502300c52e force the size of the enumerations in the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1579
diff changeset
613 _OrthancPluginCompressionType_INTERNAL = 0x7fffffff
1554
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
614 } OrthancPluginCompressionType;
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
615
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
616
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
617 /**
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
618 * 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
619 * @ingroup Images
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
620 **/
1598
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
621 typedef enum
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
622 {
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
623 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
624 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
625
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
626 _OrthancPluginImageFormat_INTERNAL = 0x7fffffff
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
627 } OrthancPluginImageFormat;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
628
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
629
1657
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
630 /**
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
631 * 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
632 * @ingroup Toolbox
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
633 **/
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
634 typedef enum
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
635 {
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
636 OrthancPluginValueRepresentation_AE = 1, /*!< Application Entity */
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
637 OrthancPluginValueRepresentation_AS = 2, /*!< Age String */
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
638 OrthancPluginValueRepresentation_AT = 3, /*!< Attribute Tag */
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
639 OrthancPluginValueRepresentation_CS = 4, /*!< Code String */
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
640 OrthancPluginValueRepresentation_DA = 5, /*!< Date */
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
641 OrthancPluginValueRepresentation_DS = 6, /*!< Decimal String */
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
642 OrthancPluginValueRepresentation_DT = 7, /*!< Date Time */
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
643 OrthancPluginValueRepresentation_FD = 8, /*!< Floating Point Double */
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
644 OrthancPluginValueRepresentation_FL = 9, /*!< Floating Point Single */
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
645 OrthancPluginValueRepresentation_IS = 10, /*!< Integer String */
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
646 OrthancPluginValueRepresentation_LO = 11, /*!< Long String */
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
647 OrthancPluginValueRepresentation_LT = 12, /*!< Long Text */
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
648 OrthancPluginValueRepresentation_OB = 13, /*!< Other Byte String */
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
649 OrthancPluginValueRepresentation_OF = 14, /*!< Other Float String */
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
650 OrthancPluginValueRepresentation_OW = 15, /*!< Other Word String */
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
651 OrthancPluginValueRepresentation_PN = 16, /*!< Person Name */
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
652 OrthancPluginValueRepresentation_SH = 17, /*!< Short String */
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
653 OrthancPluginValueRepresentation_SL = 18, /*!< Signed Long */
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
654 OrthancPluginValueRepresentation_SQ = 19, /*!< Sequence of Items */
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
655 OrthancPluginValueRepresentation_SS = 20, /*!< Signed Short */
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
656 OrthancPluginValueRepresentation_ST = 21, /*!< Short Text */
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
657 OrthancPluginValueRepresentation_TM = 22, /*!< Time */
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
658 OrthancPluginValueRepresentation_UI = 23, /*!< Unique Identifier (UID) */
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
659 OrthancPluginValueRepresentation_UL = 24, /*!< Unsigned Long */
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
660 OrthancPluginValueRepresentation_UN = 25, /*!< Unknown */
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
661 OrthancPluginValueRepresentation_US = 26, /*!< Unsigned Short */
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
662 OrthancPluginValueRepresentation_UT = 27, /*!< Unlimited Text */
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
663
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
664 _OrthancPluginValueRepresentation_INTERNAL = 0x7fffffff
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
665 } OrthancPluginValueRepresentation;
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
666
1177
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
667
1743
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
668 /**
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
669 * The possible output formats for a DICOM-to-JSON conversion.
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
670 * @ingroup Toolbox
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
671 **/
1740
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
672 typedef enum
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
673 {
1743
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
674 OrthancPluginDicomToJsonFormat_Full = 1, /*!< Full output, with most details */
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
675 OrthancPluginDicomToJsonFormat_Short = 2, /*!< Tags output as hexadecimal numbers */
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
676 OrthancPluginDicomToJsonFormat_Simple = 3, /*!< Human-readable JSON */
1740
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
677
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
678 _OrthancPluginDicomToJsonFormat_INTERNAL = 0x7fffffff
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
679 } OrthancPluginDicomToJsonFormat;
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
680
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
681
1743
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
682 /**
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
683 * Flags to customize a DICOM-to-JSON conversion. By default, binary
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
684 * tags are formatted using Data URI scheme.
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
685 * @ingroup Toolbox
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
686 **/
1740
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
687 typedef enum
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
688 {
1743
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
689 OrthancPluginDicomToJsonFlags_IncludeBinary = (1 << 0), /*!< Include the binary tags */
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
690 OrthancPluginDicomToJsonFlags_IncludePrivateTags = (1 << 1), /*!< Include the private tags */
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
691 OrthancPluginDicomToJsonFlags_IncludeUnknownTags = (1 << 2), /*!< Include the tags unknown by the dictionary */
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
692 OrthancPluginDicomToJsonFlags_IncludePixelData = (1 << 3), /*!< Include the pixel data */
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
693 OrthancPluginDicomToJsonFlags_ConvertBinaryToAscii = (1 << 4), /*!< Output binary tags as-is, dropping non-ASCII */
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
694 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
695
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
696 _OrthancPluginDicomToJsonFlags_INTERNAL = 0x7fffffff
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
697 } OrthancPluginDicomToJsonFlags;
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
698
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
699
1177
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
700 /**
1821
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
701 * Flags to customize a JSON-to-DICOM conversion.
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
702 * @ingroup Toolbox
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
703 **/
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
704 typedef enum
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
705 {
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
706 OrthancPluginDicomFromJsonFlags_DecodeDataUriScheme = (1 << 0), /*!< Decode fields encoded using data URI scheme */
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
707 OrthancPluginDicomFromJsonFlags_GenerateIdentifiers = (1 << 1), /*!< Automatically generate DICOM identifiers */
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
708
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
709 _OrthancPluginDicomFromJsonFlags_INTERNAL = 0x7fffffff
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
710 } OrthancPluginDicomFromJsonFlags;
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
711
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
712
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
713 /**
1760
51db4a25a741 LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1746
diff changeset
714 * The constraints on the DICOM identifiers that must be supported
51db4a25a741 LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1746
diff changeset
715 * by the database plugins.
51db4a25a741 LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1746
diff changeset
716 **/
51db4a25a741 LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1746
diff changeset
717 typedef enum
51db4a25a741 LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1746
diff changeset
718 {
1815
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
719 OrthancPluginIdentifierConstraint_Equal = 1, /*!< Equal */
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
720 OrthancPluginIdentifierConstraint_SmallerOrEqual = 2, /*!< Less or equal */
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
721 OrthancPluginIdentifierConstraint_GreaterOrEqual = 3, /*!< More or equal */
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
722 OrthancPluginIdentifierConstraint_Wildcard = 4, /*!< Case-sensitive wildcard matching (with * and ?) */
1760
51db4a25a741 LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1746
diff changeset
723
51db4a25a741 LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1746
diff changeset
724 _OrthancPluginIdentifierConstraint_INTERNAL = 0x7fffffff
51db4a25a741 LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1746
diff changeset
725 } OrthancPluginIdentifierConstraint;
51db4a25a741 LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1746
diff changeset
726
51db4a25a741 LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1746
diff changeset
727
1815
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
728 /**
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
729 * The origin of a DICOM instance that has been received by Orthanc.
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
730 **/
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
731 typedef enum
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
732 {
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
733 OrthancPluginInstanceOrigin_Unknown = 1, /*!< Unknown origin */
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
734 OrthancPluginInstanceOrigin_DicomProtocol = 2, /*!< Instance received through DICOM protocol */
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
735 OrthancPluginInstanceOrigin_RestApi = 3, /*!< Instance received through REST API of Orthanc */
1816
87c069c94ac9 plugin sample: automated jpeg2k compression
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1815
diff changeset
736 OrthancPluginInstanceOrigin_Plugin = 4, /*!< Instance added to Orthanc by a plugin */
1815
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
737 OrthancPluginInstanceOrigin_Lua = 5, /*!< Instance added to Orthanc by a Lua script */
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
738
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
739 _OrthancPluginInstanceOrigin_INTERNAL = 0x7fffffff
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
740 } OrthancPluginInstanceOrigin;
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
741
1760
51db4a25a741 LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1746
diff changeset
742
51db4a25a741 LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1746
diff changeset
743 /**
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
744 * @brief A memory buffer allocated by the core system of Orthanc.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
745 *
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
746 * A memory buffer allocated by the core system of Orthanc. When the
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
747 * content of the buffer is not useful anymore, it must be free by a
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
748 * call to ::OrthancPluginFreeMemoryBuffer().
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
749 **/
904
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
750 typedef struct
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
751 {
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
752 /**
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
753 * @brief The content of the buffer.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
754 **/
904
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
755 void* data;
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
756
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
757 /**
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
758 * @brief The number of bytes in the buffer.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
759 **/
904
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
760 uint32_t size;
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
761 } OrthancPluginMemoryBuffer;
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
762
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
763
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
764
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
765
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
766 /**
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
767 * @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
768 * @ingroup Callback
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
769 **/
900
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
770 typedef struct _OrthancPluginRestOutput_t OrthancPluginRestOutput;
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
771
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
772
1066
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
773
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
774 /**
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
775 * @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
776 **/
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
777 typedef struct _OrthancPluginDicomInstance_t OrthancPluginDicomInstance;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
778
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
779
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
780
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
781 /**
1615
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
782 * @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
783 * @ingroup Images
1598
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
784 **/
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
785 typedef struct _OrthancPluginImage_t OrthancPluginImage;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
786
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
787
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
788
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
789 /**
1615
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
790 * @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
791 * @ingroup Images
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
792 **/
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
793 typedef struct _OrthancPluginStorageArea_t OrthancPluginStorageArea;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
794
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
795
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
796
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
797 /**
1799
4f01c9d73f02 calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
798 * @brief Opaque structure to an object that represents a C-Find query.
4f01c9d73f02 calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
799 * @ingroup Worklists
4f01c9d73f02 calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
800 **/
4f01c9d73f02 calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
801 typedef struct _OrthancPluginWorklistQuery_t OrthancPluginWorklistQuery;
4f01c9d73f02 calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
802
4f01c9d73f02 calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
803
4f01c9d73f02 calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
804
4f01c9d73f02 calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
805 /**
4f01c9d73f02 calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
806 * @brief Opaque structure to an object that represents the answers to a C-Find query.
4f01c9d73f02 calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
807 * @ingroup Worklists
4f01c9d73f02 calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
808 **/
4f01c9d73f02 calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
809 typedef struct _OrthancPluginWorklistAnswers_t OrthancPluginWorklistAnswers;
4f01c9d73f02 calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
810
4f01c9d73f02 calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
811
4f01c9d73f02 calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
812
4f01c9d73f02 calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
813 /**
908
e078ea944089 refactoring HttpOutput
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 907
diff changeset
814 * @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
815 * @ingroup Callbacks
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
816 **/
1628
77c4cc4def0f OrthancPluginErrorCode in REST callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1627
diff changeset
817 typedef OrthancPluginErrorCode (*OrthancPluginRestCallback) (
900
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
818 OrthancPluginRestOutput* output,
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
819 const char* url,
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
820 const OrthancPluginHttpRequest* request);
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
821
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
822
1066
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
823
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
824 /**
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
825 * @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
826 * @ingroup Callbacks
1066
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
827 **/
1627
da7854deb662 Plugin callbacks must now return explicit "OrthancPluginErrorCode" instead of integers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1615
diff changeset
828 typedef OrthancPluginErrorCode (*OrthancPluginOnStoredInstanceCallback) (
1066
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
829 OrthancPluginDicomInstance* instance,
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
830 const char* instanceId);
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
831
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
832
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
833
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
834 /**
1177
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
835 * @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
836 * @ingroup Callbacks
1177
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
837 **/
1627
da7854deb662 Plugin callbacks must now return explicit "OrthancPluginErrorCode" instead of integers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1615
diff changeset
838 typedef OrthancPluginErrorCode (*OrthancPluginOnChangeCallback) (
1177
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
839 OrthancPluginChangeType changeType,
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
840 OrthancPluginResourceType resourceType,
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
841 const char* resourceId);
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
842
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
843
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
844
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
845 /**
1135
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
846 * @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
847 **/
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
848 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
849
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
850
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
851
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
852 /**
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
853 * @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
854 *
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
855 * 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
856 *
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
857 * @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
858 * @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
859 * @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
860 * @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
861 * @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
862 * @ingroup Callbacks
1135
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
863 **/
1627
da7854deb662 Plugin callbacks must now return explicit "OrthancPluginErrorCode" instead of integers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1615
diff changeset
864 typedef OrthancPluginErrorCode (*OrthancPluginStorageCreate) (
1135
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
865 const char* uuid,
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
866 const void* content,
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
867 int64_t size,
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
868 OrthancPluginContentType type);
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
869
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
870
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
871
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
872 /**
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
873 * @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
874 *
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
875 * 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
876 *
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
877 * @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
878 * @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
879 * @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
880 * @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
881 * @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
882 * @ingroup Callbacks
1135
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
883 **/
1627
da7854deb662 Plugin callbacks must now return explicit "OrthancPluginErrorCode" instead of integers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1615
diff changeset
884 typedef OrthancPluginErrorCode (*OrthancPluginStorageRead) (
1135
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
885 void** content,
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
886 int64_t* size,
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
887 const char* uuid,
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
888 OrthancPluginContentType type);
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
889
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
890
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
891
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
892 /**
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
893 * @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
894 *
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
895 * 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
896 *
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
897 * @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
898 * @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
899 * @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
900 * @ingroup Callbacks
1135
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
901 **/
1627
da7854deb662 Plugin callbacks must now return explicit "OrthancPluginErrorCode" instead of integers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1615
diff changeset
902 typedef OrthancPluginErrorCode (*OrthancPluginStorageRemove) (
1135
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
903 const char* uuid,
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
904 OrthancPluginContentType type);
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
905
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
906
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
907
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
908 /**
1799
4f01c9d73f02 calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
909 * @brief Callback to handle the C-Find SCP requests received by Orthanc.
4f01c9d73f02 calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
910 *
1803
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
911 * Signature of a callback function that is triggered when Orthanc
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
912 * receives a C-Find SCP request against modality worklists.
1799
4f01c9d73f02 calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
913 *
1800
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
914 * @param answers The target structure where answers must be stored.
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
915 * @param query The worklist query.
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
916 * @param remoteAet The Application Entity Title (AET) of the modality from which the request originates.
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
917 * @param calledAet The Application Entity Title (AET) of the modality that is called by the request.
1799
4f01c9d73f02 calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
918 * @return 0 if success, other value if error.
4f01c9d73f02 calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
919 * @ingroup Worklists
4f01c9d73f02 calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
920 **/
1800
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
921 typedef OrthancPluginErrorCode (*OrthancPluginWorklistCallback) (
1799
4f01c9d73f02 calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
922 OrthancPluginWorklistAnswers* answers,
4f01c9d73f02 calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
923 const OrthancPluginWorklistQuery* query,
1800
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
924 const char* remoteAet,
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
925 const char* calledAet);
1799
4f01c9d73f02 calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
926
4f01c9d73f02 calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
927
4f01c9d73f02 calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
928
4f01c9d73f02 calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1786
diff changeset
929 /**
1297
501432928727 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1295
diff changeset
930 * @brief Data structure that contains information about the Orthanc core.
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
931 **/
900
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
932 typedef struct _OrthancPluginContext_t
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
933 {
1581
357c4bb15701 Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1580
diff changeset
934 void* pluginsManager;
357c4bb15701 Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1580
diff changeset
935 const char* orthancVersion;
357c4bb15701 Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1580
diff changeset
936 OrthancPluginFree Free;
357c4bb15701 Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1580
diff changeset
937 OrthancPluginErrorCode (*InvokeService) (struct _OrthancPluginContext_t* context,
357c4bb15701 Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1580
diff changeset
938 _OrthancPluginService service,
357c4bb15701 Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1580
diff changeset
939 const void* params);
899
bb0a51561016 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 898
diff changeset
940 } OrthancPluginContext;
bb0a51561016 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 898
diff changeset
941
886
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
942
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
943
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
944 /**
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
945 * @brief Free a string.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
946 *
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
947 * Free a string that was allocated by the core system of Orthanc.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
948 *
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
949 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
950 * @param str The string to be freed.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
951 **/
904
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
952 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeString(
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
953 OrthancPluginContext* context,
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
954 char* str)
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
955 {
1037
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
956 if (str != NULL)
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
957 {
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
958 context->Free(str);
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
959 }
904
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
960 }
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
961
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
962
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
963 /**
1041
2c49b7dffcec plugins have access to the HTTP headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1040
diff changeset
964 * @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
965 *
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
966 * 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
967 * 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
968 * this function should always be checked in the
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
969 * OrthancPluginInitialize() entry point of the plugin.
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
970 *
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
971 * @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
972 * @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
973 * 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
974 * @ingroup Callbacks
1039
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
975 **/
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
976 ORTHANC_PLUGIN_INLINE int OrthancPluginCheckVersion(
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
977 OrthancPluginContext* context)
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
978 {
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
979 int major, minor, revision;
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
980
1579
b93c398f934d check the size of the enumerations in the plugin engine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1578
diff changeset
981 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
982 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
983 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
984 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
985 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
986 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
987 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
988 sizeof(int32_t) != sizeof(OrthancPluginChangeType) ||
1598
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
989 sizeof(int32_t) != sizeof(OrthancPluginCompressionType) ||
1657
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
990 sizeof(int32_t) != sizeof(OrthancPluginImageFormat) ||
1740
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
991 sizeof(int32_t) != sizeof(OrthancPluginValueRepresentation) ||
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
992 sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFormat) ||
1760
51db4a25a741 LookupIdentifier is plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1746
diff changeset
993 sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFlags) ||
1821
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
994 sizeof(int32_t) != sizeof(OrthancPluginDicomFromJsonFlags) ||
1815
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
995 sizeof(int32_t) != sizeof(OrthancPluginIdentifierConstraint) ||
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
996 sizeof(int32_t) != sizeof(OrthancPluginInstanceOrigin))
1578
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1554
diff changeset
997 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1554
diff changeset
998 /* Mismatch in the size of the enumerations */
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1554
diff changeset
999 return 0;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1554
diff changeset
1000 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1554
diff changeset
1001
1039
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1002 /* Assume compatibility with the mainline */
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1003 if (!strcmp(context->orthancVersion, "mainline"))
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1004 {
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1005 return 1;
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1006 }
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1007
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1008 /* Parse the version of the Orthanc core */
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1009 if (
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1010 #ifdef _MSC_VER
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1011 sscanf_s
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1012 #else
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1013 sscanf
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1014 #endif
1303
bba8a47922d1 cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1297
diff changeset
1015 (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
1016 {
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1017 return 0;
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1018 }
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1019
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1020 /* Check the major number of the version */
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1021
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1022 if (major > ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER)
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1023 {
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1024 return 1;
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1025 }
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1026
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1027 if (major < ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER)
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1028 {
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1029 return 0;
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1030 }
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1031
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1032 /* Check the minor number of the version */
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1033
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1034 if (minor > ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER)
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1035 {
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1036 return 1;
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1037 }
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1038
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1039 if (minor < ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER)
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1040 {
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1041 return 0;
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1042 }
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1043
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1044 /* Check the revision number of the version */
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1045
1040
d06186cdc502 check plugin version in samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1039
diff changeset
1046 if (revision >= ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER)
1039
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1047 {
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1048 return 1;
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1049 }
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1050 else
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1051 {
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1052 return 0;
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1053 }
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1054 }
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1055
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1056
5a5a4890ffca check version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1037
diff changeset
1057 /**
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1058 * @brief Free a memory buffer.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1059 *
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1060 * Free a memory buffer that was allocated by the core system of Orthanc.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1061 *
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1062 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1063 * @param buffer The memory buffer to release.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1064 **/
904
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
1065 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeMemoryBuffer(
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
1066 OrthancPluginContext* context,
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
1067 OrthancPluginMemoryBuffer* buffer)
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
1068 {
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
1069 context->Free(buffer->data);
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
1070 }
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
1071
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
1072
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1073 /**
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1074 * @brief Log an error.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1075 *
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1076 * Log an error message using the Orthanc logging system.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1077 *
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1078 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1079 * @param message The message to be logged.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1080 **/
900
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
1081 ORTHANC_PLUGIN_INLINE void OrthancPluginLogError(
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
1082 OrthancPluginContext* context,
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1083 const char* message)
898
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
1084 {
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1085 context->InvokeService(context, _OrthancPluginService_LogError, message);
898
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
1086 }
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
1087
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
1088
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1089 /**
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1090 * @brief Log a warning.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1091 *
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1092 * Log a warning message using the Orthanc logging system.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1093 *
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1094 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1095 * @param message The message to be logged.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1096 **/
900
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
1097 ORTHANC_PLUGIN_INLINE void OrthancPluginLogWarning(
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
1098 OrthancPluginContext* context,
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1099 const char* message)
898
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
1100 {
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1101 context->InvokeService(context, _OrthancPluginService_LogWarning, message);
898
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
1102 }
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
1103
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
1104
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1105 /**
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1106 * @brief Log an information.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1107 *
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1108 * Log an information message using the Orthanc logging system.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1109 *
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1110 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1111 * @param message The message to be logged.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1112 **/
900
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
1113 ORTHANC_PLUGIN_INLINE void OrthancPluginLogInfo(
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
1114 OrthancPluginContext* context,
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1115 const char* message)
898
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
1116 {
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1117 context->InvokeService(context, _OrthancPluginService_LogInfo, message);
898
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
1118 }
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
1119
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
1120
913
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1121
901
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1122 typedef struct
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1123 {
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1124 const char* pathRegularExpression;
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1125 OrthancPluginRestCallback callback;
904
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
1126 } _OrthancPluginRestCallback;
901
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1127
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1128 /**
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1129 * @brief Register a REST callback.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1130 *
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1131 * This function registers a REST callback against a regular
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1132 * expression for a URI. This function must be called during the
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1133 * initialization of the plugin, i.e. inside the
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1134 * OrthancPluginInitialize() public function.
1595
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1135 *
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1136 * Each REST callback is guaranteed to run in mutual exclusion.
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1137 *
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1138 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1139 * @param pathRegularExpression Regular expression for the URI. May contain groups.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1140 * @param callback The callback function to handle the REST call.
1595
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1141 * @see OrthancPluginRegisterRestCallbackNoLock()
1601
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
1142 * @ingroup Callbacks
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1143 **/
900
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
1144 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallback(
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
1145 OrthancPluginContext* context,
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
1146 const char* pathRegularExpression,
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
1147 OrthancPluginRestCallback callback)
899
bb0a51561016 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 898
diff changeset
1148 {
904
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
1149 _OrthancPluginRestCallback params;
899
bb0a51561016 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 898
diff changeset
1150 params.pathRegularExpression = pathRegularExpression;
bb0a51561016 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 898
diff changeset
1151 params.callback = callback;
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1152 context->InvokeService(context, _OrthancPluginService_RegisterRestCallback, &params);
899
bb0a51561016 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 898
diff changeset
1153 }
bb0a51561016 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 898
diff changeset
1154
bb0a51561016 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 898
diff changeset
1155
913
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1156
1595
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1157 /**
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1158 * @brief Register a REST callback, without locking.
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1159 *
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1160 * This function registers a REST callback against a regular
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1161 * expression for a URI. This function must be called during the
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1162 * initialization of the plugin, i.e. inside the
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1163 * OrthancPluginInitialize() public function.
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1164 *
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1165 * Contrarily to OrthancPluginRegisterRestCallback(), the callback
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1166 * 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
1167 * high-performance plugins that must handle concurrent requests
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1168 * (Orthanc uses a pool of threads, one thread being assigned to
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1169 * 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
1170 * implement the required locking mechanisms.
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1171 *
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1172 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1173 * @param pathRegularExpression Regular expression for the URI. May contain groups.
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1174 * @param callback The callback function to handle the REST call.
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1175 * @see OrthancPluginRegisterRestCallback()
1601
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
1176 * @ingroup Callbacks
1595
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1177 **/
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1178 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallbackNoLock(
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1179 OrthancPluginContext* context,
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1180 const char* pathRegularExpression,
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1181 OrthancPluginRestCallback callback)
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1182 {
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1183 _OrthancPluginRestCallback params;
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1184 params.pathRegularExpression = pathRegularExpression;
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1185 params.callback = callback;
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1186 context->InvokeService(context, _OrthancPluginService_RegisterRestCallbackNoLock, &params);
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1187 }
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1188
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1189
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
1190
901
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1191 typedef struct
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1192 {
1066
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1193 OrthancPluginOnStoredInstanceCallback callback;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1194 } _OrthancPluginOnStoredInstanceCallback;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1195
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1196 /**
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1197 * @brief Register a callback for received instances.
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1198 *
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1199 * This function registers a callback function that is called
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1200 * 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
1201 *
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1202 * @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
1203 * @param callback The callback function.
1601
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
1204 * @ingroup Callbacks
1066
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1205 **/
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1206 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnStoredInstanceCallback(
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1207 OrthancPluginContext* context,
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1208 OrthancPluginOnStoredInstanceCallback callback)
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1209 {
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1210 _OrthancPluginOnStoredInstanceCallback params;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1211 params.callback = callback;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1212
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1213 context->InvokeService(context, _OrthancPluginService_RegisterOnStoredInstanceCallback, &params);
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1214 }
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1215
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1216
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1217
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1218 typedef struct
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1219 {
901
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1220 OrthancPluginRestOutput* output;
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1221 const char* answer;
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1222 uint32_t answerSize;
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1223 const char* mimeType;
904
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
1224 } _OrthancPluginAnswerBuffer;
901
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1225
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1226 /**
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1227 * @brief Answer to a REST request.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1228 *
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1229 * This function answers to a REST request with the content of a memory buffer.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1230 *
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1231 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1232 * @param output The HTTP connection to the client application.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1233 * @param answer Pointer to the memory buffer containing the answer.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1234 * @param answerSize Number of bytes of the answer.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1235 * @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
1236 * @ingroup REST
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1237 **/
900
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
1238 ORTHANC_PLUGIN_INLINE void OrthancPluginAnswerBuffer(
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
1239 OrthancPluginContext* context,
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
1240 OrthancPluginRestOutput* output,
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
1241 const char* answer,
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
1242 uint32_t answerSize,
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
1243 const char* mimeType)
899
bb0a51561016 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 898
diff changeset
1244 {
904
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
1245 _OrthancPluginAnswerBuffer params;
899
bb0a51561016 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 898
diff changeset
1246 params.output = output;
bb0a51561016 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 898
diff changeset
1247 params.answer = answer;
bb0a51561016 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 898
diff changeset
1248 params.answerSize = answerSize;
bb0a51561016 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 898
diff changeset
1249 params.mimeType = mimeType;
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1250 context->InvokeService(context, _OrthancPluginService_AnswerBuffer, &params);
899
bb0a51561016 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 898
diff changeset
1251 }
bb0a51561016 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 898
diff changeset
1252
bb0a51561016 refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 898
diff changeset
1253
901
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1254 typedef struct
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1255 {
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1256 OrthancPluginRestOutput* output;
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1257 OrthancPluginPixelFormat format;
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1258 uint32_t width;
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1259 uint32_t height;
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1260 uint32_t pitch;
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1261 const void* buffer;
904
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
1262 } _OrthancPluginCompressAndAnswerPngImage;
901
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1263
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
1264 typedef struct
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
1265 {
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
1266 OrthancPluginRestOutput* output;
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
1267 OrthancPluginImageFormat imageFormat;
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
1268 OrthancPluginPixelFormat pixelFormat;
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
1269 uint32_t width;
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
1270 uint32_t height;
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
1271 uint32_t pitch;
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
1272 const void* buffer;
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
1273 uint8_t quality;
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
1274 } _OrthancPluginCompressAndAnswerImage;
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
1275
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
1276
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1277 /**
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1278 * @brief Answer to a REST request with a PNG image.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1279 *
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1280 * This function answers to a REST request with a PNG image. The
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1281 * parameters of this function describe a memory buffer that
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1282 * contains an uncompressed image. The image will be automatically compressed
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1283 * as a PNG image by the core system of Orthanc.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1284 *
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1285 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1286 * @param output The HTTP connection to the client application.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1287 * @param format The memory layout of the uncompressed image.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1288 * @param width The width of the image.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1289 * @param height The height of the image.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1290 * @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
1291 * between 2 successive lines of the image in the memory buffer).
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1292 * @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
1293 * @ingroup REST
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1294 **/
901
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1295 ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerPngImage(
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1296 OrthancPluginContext* context,
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1297 OrthancPluginRestOutput* output,
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1298 OrthancPluginPixelFormat format,
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1299 uint32_t width,
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1300 uint32_t height,
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1301 uint32_t pitch,
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1302 const void* buffer)
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1303 {
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
1304 _OrthancPluginCompressAndAnswerImage params;
901
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1305 params.output = output;
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
1306 params.imageFormat = OrthancPluginImageFormat_Png;
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
1307 params.pixelFormat = format;
901
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1308 params.width = width;
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1309 params.height = height;
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1310 params.pitch = pitch;
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1311 params.buffer = buffer;
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
1312 params.quality = 0; /* No quality for PNG */
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
1313 context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, &params);
901
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1314 }
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1315
7d88f3f4a3b3 refactoring IsServedUri, answer PNG images, regular expression groups
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 900
diff changeset
1316
913
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1317
904
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
1318 typedef struct
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
1319 {
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
1320 OrthancPluginMemoryBuffer* target;
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
1321 const char* instanceId;
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
1322 } _OrthancPluginGetDicomForInstance;
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
1323
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1324 /**
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1325 * @brief Retrieve a DICOM instance using its Orthanc identifier.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1326 *
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1327 * Retrieve a DICOM instance using its Orthanc identifier. The DICOM
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1328 * file is stored into a newly allocated memory buffer.
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1329 *
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1330 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1821
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
1331 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1332 * @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
1333 * @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
1334 * @ingroup Orthanc
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1335 **/
1581
357c4bb15701 Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1580
diff changeset
1336 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginGetDicomForInstance(
904
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
1337 OrthancPluginContext* context,
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
1338 OrthancPluginMemoryBuffer* target,
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
1339 const char* instanceId)
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
1340 {
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
1341 _OrthancPluginGetDicomForInstance params;
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
1342 params.target = target;
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
1343 params.instanceId = instanceId;
907
9b8298234254 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 906
diff changeset
1344 return context->InvokeService(context, _OrthancPluginService_GetDicomForInstance, &params);
904
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
1345 }
2732b5f57d9c sample to forward dicom data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 901
diff changeset
1346
898
7000fc86fe62 improved plugin api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 897
diff changeset
1347
912
dcb2469f00f4 PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 908
diff changeset
1348
dcb2469f00f4 PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 908
diff changeset
1349 typedef struct
dcb2469f00f4 PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 908
diff changeset
1350 {
dcb2469f00f4 PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 908
diff changeset
1351 OrthancPluginMemoryBuffer* target;
dcb2469f00f4 PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 908
diff changeset
1352 const char* uri;
dcb2469f00f4 PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 908
diff changeset
1353 } _OrthancPluginRestApiGet;
dcb2469f00f4 PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 908
diff changeset
1354
913
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1355 /**
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1356 * @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
1357 *
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1358 * 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
1359 * 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
1360 *
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1361 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1821
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
1362 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
913
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1363 * @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
1364 * @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
1365 * @see OrthancPluginRestApiGetAfterPlugins
1601
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
1366 * @ingroup Orthanc
913
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1367 **/
1581
357c4bb15701 Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1580
diff changeset
1368 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGet(
912
dcb2469f00f4 PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 908
diff changeset
1369 OrthancPluginContext* context,
dcb2469f00f4 PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 908
diff changeset
1370 OrthancPluginMemoryBuffer* target,
dcb2469f00f4 PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 908
diff changeset
1371 const char* uri)
dcb2469f00f4 PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 908
diff changeset
1372 {
dcb2469f00f4 PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 908
diff changeset
1373 _OrthancPluginRestApiGet params;
dcb2469f00f4 PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 908
diff changeset
1374 params.target = target;
dcb2469f00f4 PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 908
diff changeset
1375 params.uri = uri;
dcb2469f00f4 PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 908
diff changeset
1376 return context->InvokeService(context, _OrthancPluginService_RestApiGet, &params);
dcb2469f00f4 PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 908
diff changeset
1377 }
dcb2469f00f4 PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 908
diff changeset
1378
dcb2469f00f4 PluginsHttpHandler::RestApiGet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 908
diff changeset
1379
913
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1380
1282
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1381 /**
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1382 * @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
1383 *
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1384 * 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
1385 * 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
1386 * 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
1387 * 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
1388 * 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
1389 *
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1390 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1821
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
1391 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
1282
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1392 * @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
1393 * @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
1394 * @see OrthancPluginRestApiGet
1601
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
1395 * @ingroup Orthanc
1282
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1396 **/
1581
357c4bb15701 Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1580
diff changeset
1397 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
1398 OrthancPluginContext* context,
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1399 OrthancPluginMemoryBuffer* target,
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1400 const char* uri)
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 _OrthancPluginRestApiGet params;
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1403 params.target = target;
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1404 params.uri = uri;
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1405 return context->InvokeService(context, _OrthancPluginService_RestApiGetAfterPlugins, &params);
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1406 }
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1407
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
913
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1410 typedef struct
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1411 {
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1412 OrthancPluginMemoryBuffer* target;
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1413 const char* uri;
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1414 const char* body;
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1415 uint32_t bodySize;
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1416 } _OrthancPluginRestApiPostPut;
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1417
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1418 /**
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1419 * @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
1420 *
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1421 * 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
1422 * 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
1423 *
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1424 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1821
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
1425 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
913
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1426 * @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
1427 * @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
1428 * @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
1429 * @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
1430 * @see OrthancPluginRestApiPostAfterPlugins
1601
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
1431 * @ingroup Orthanc
913
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1432 **/
1581
357c4bb15701 Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1580
diff changeset
1433 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPost(
913
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1434 OrthancPluginContext* context,
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1435 OrthancPluginMemoryBuffer* target,
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1436 const char* uri,
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1437 const char* body,
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1438 uint32_t bodySize)
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1439 {
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1440 _OrthancPluginRestApiPostPut params;
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1441 params.target = target;
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1442 params.uri = uri;
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1443 params.body = body;
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1444 params.bodySize = bodySize;
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1445 return context->InvokeService(context, _OrthancPluginService_RestApiPost, &params);
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1446 }
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1447
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1448
1282
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1449 /**
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1450 * @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
1451 *
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1452 * 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
1453 * 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
1454 * 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
1455 * 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
1456 * 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
1457 *
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1458 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1821
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
1459 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
1282
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1460 * @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
1461 * @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
1462 * @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
1463 * @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
1464 * @see OrthancPluginRestApiPost
1601
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
1465 * @ingroup Orthanc
1282
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1466 **/
1581
357c4bb15701 Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1580
diff changeset
1467 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
1468 OrthancPluginContext* context,
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1469 OrthancPluginMemoryBuffer* target,
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1470 const char* uri,
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1471 const char* body,
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1472 uint32_t bodySize)
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1473 {
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1474 _OrthancPluginRestApiPostPut params;
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1475 params.target = target;
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1476 params.uri = uri;
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1477 params.body = body;
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1478 params.bodySize = bodySize;
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1479 return context->InvokeService(context, _OrthancPluginService_RestApiPostAfterPlugins, &params);
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
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1482
913
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1483
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1484 /**
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1485 * @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
1486 *
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1487 * 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
1488 *
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1489 * @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
1490 * @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
1491 * @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
1492 * @see OrthancPluginRestApiDeleteAfterPlugins
1601
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
1493 * @ingroup Orthanc
913
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1494 **/
1581
357c4bb15701 Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1580
diff changeset
1495 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiDelete(
913
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1496 OrthancPluginContext* context,
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1497 const char* uri)
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1498 {
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1499 return context->InvokeService(context, _OrthancPluginService_RestApiDelete, uri);
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1500 }
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1501
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1502
1282
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1503 /**
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1504 * @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
1505 *
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1506 * 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
1507 * 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
1508 * 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
1509 * 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
1510 *
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1511 * @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
1512 * @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
1513 * @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
1514 * @see OrthancPluginRestApiDelete
1601
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
1515 * @ingroup Orthanc
1282
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1516 **/
1581
357c4bb15701 Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1580
diff changeset
1517 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
1518 OrthancPluginContext* context,
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1519 const char* uri)
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1520 {
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1521 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
1522 }
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1523
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1524
913
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1525
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1526 /**
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1527 * @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
1528 *
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1529 * 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
1530 * 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
1531 *
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1532 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1821
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
1533 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
913
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1534 * @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
1535 * @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
1536 * @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
1537 * @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
1538 * @see OrthancPluginRestApiPutAfterPlugins
1601
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
1539 * @ingroup Orthanc
913
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1540 **/
1581
357c4bb15701 Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1580
diff changeset
1541 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPut(
913
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1542 OrthancPluginContext* context,
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1543 OrthancPluginMemoryBuffer* target,
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1544 const char* uri,
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1545 const char* body,
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1546 uint32_t bodySize)
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1547 {
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1548 _OrthancPluginRestApiPostPut params;
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1549 params.target = target;
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1550 params.uri = uri;
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1551 params.body = body;
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1552 params.bodySize = bodySize;
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1553 return context->InvokeService(context, _OrthancPluginService_RestApiPut, &params);
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1554 }
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1555
3e43de893d88 POST, DELETE, PUT from Orthanc plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 912
diff changeset
1556
1042
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1557
1282
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1558 /**
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1559 * @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
1560 *
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1561 * 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
1562 * 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
1563 * 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
1564 * 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
1565 * 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
1566 *
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1567 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1821
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
1568 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
1282
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1569 * @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
1570 * @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
1571 * @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
1572 * @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
1573 * @see OrthancPluginRestApiPut
1601
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
1574 * @ingroup Orthanc
1282
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1575 **/
1581
357c4bb15701 Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1580
diff changeset
1576 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
1577 OrthancPluginContext* context,
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1578 OrthancPluginMemoryBuffer* target,
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1579 const char* uri,
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1580 const char* body,
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1581 uint32_t bodySize)
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1582 {
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1583 _OrthancPluginRestApiPostPut params;
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1584 params.target = target;
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1585 params.uri = uri;
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1586 params.body = body;
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1587 params.bodySize = bodySize;
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1588 return context->InvokeService(context, _OrthancPluginService_RestApiPutAfterPlugins, &params);
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1589 }
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1590
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1591
7bccdd221e2b Plugins can do REST calls to other plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1280
diff changeset
1592
993
501880d76474 improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 913
diff changeset
1593 typedef struct
501880d76474 improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 913
diff changeset
1594 {
501880d76474 improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 913
diff changeset
1595 OrthancPluginRestOutput* output;
1042
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1596 const char* argument;
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1597 } _OrthancPluginOutputPlusArgument;
993
501880d76474 improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 913
diff changeset
1598
501880d76474 improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 913
diff changeset
1599 /**
1042
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1600 * @brief Redirect a REST request.
993
501880d76474 improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 913
diff changeset
1601 *
501880d76474 improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 913
diff changeset
1602 * 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
1603 * to another URI using HTTP status 301.
501880d76474 improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 913
diff changeset
1604 *
501880d76474 improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 913
diff changeset
1605 * @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
1606 * @param output The HTTP connection to the client application.
501880d76474 improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 913
diff changeset
1607 * @param redirection Where to redirect.
1601
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
1608 * @ingroup REST
993
501880d76474 improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 913
diff changeset
1609 **/
501880d76474 improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 913
diff changeset
1610 ORTHANC_PLUGIN_INLINE void OrthancPluginRedirect(
501880d76474 improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 913
diff changeset
1611 OrthancPluginContext* context,
501880d76474 improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 913
diff changeset
1612 OrthancPluginRestOutput* output,
501880d76474 improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 913
diff changeset
1613 const char* redirection)
501880d76474 improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 913
diff changeset
1614 {
1042
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1615 _OrthancPluginOutputPlusArgument params;
993
501880d76474 improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 913
diff changeset
1616 params.output = output;
1042
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1617 params.argument = redirection;
993
501880d76474 improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 913
diff changeset
1618 context->InvokeService(context, _OrthancPluginService_Redirect, &params);
501880d76474 improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 913
diff changeset
1619 }
501880d76474 improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 913
diff changeset
1620
501880d76474 improvements to GDCM plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 913
diff changeset
1621
1037
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1622
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1623 typedef struct
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1624 {
1145
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
1625 char** result;
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
1626 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
1627 } _OrthancPluginRetrieveDynamicString;
1037
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1628
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1629 /**
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1630 * @brief Look for a patient.
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1631 *
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1632 * 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
1633 * 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
1634 * over all the stored patients).
1037
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1635 *
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1636 * @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
1637 * @param patientID The Patient ID of interest.
1068
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
1638 * @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
1639 * 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
1640 * @ingroup Orthanc
1037
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1641 **/
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1642 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupPatient(
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1643 OrthancPluginContext* context,
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1644 const char* patientID)
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1645 {
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1646 char* result;
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1647
1145
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
1648 _OrthancPluginRetrieveDynamicString params;
1037
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1649 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
1650 params.argument = patientID;
1037
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1651
1599
dd1f9e81f891 fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
1652 if (context->InvokeService(context, _OrthancPluginService_LookupPatient, &params) != OrthancPluginErrorCode_Success)
1037
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1653 {
1067
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
1654 /* Error */
1037
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1655 return NULL;
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1656 }
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1657 else
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1658 {
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1659 return result;
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1660 }
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1661 }
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1662
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1663
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 * @brief Look for a study.
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 * 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
1668 * 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
1669 * over all the stored studies).
1037
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1670 *
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1671 * @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
1672 * @param studyUID The Study Instance UID of interest.
1068
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
1673 * @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
1674 * 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
1675 * @ingroup Orthanc
1037
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1676 **/
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1677 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudy(
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1678 OrthancPluginContext* context,
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1679 const char* studyUID)
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1680 {
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1681 char* result;
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1682
1145
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
1683 _OrthancPluginRetrieveDynamicString params;
1037
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1684 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
1685 params.argument = studyUID;
1037
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1686
1599
dd1f9e81f891 fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
1687 if (context->InvokeService(context, _OrthancPluginService_LookupStudy, &params) != OrthancPluginErrorCode_Success)
1037
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1688 {
1067
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
1689 /* Error */
1037
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1690 return NULL;
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1691 }
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1692 else
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1693 {
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1694 return result;
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1695 }
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
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 /**
1069
a91b4900f06a plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1068
diff changeset
1700 * @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
1701 *
a91b4900f06a plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1068
diff changeset
1702 * 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
1703 * 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
1704 * over all the stored studies).
a91b4900f06a plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1068
diff changeset
1705 *
a91b4900f06a plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1068
diff changeset
1706 * @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
1707 * @param accessionNumber The Accession Number of interest.
a91b4900f06a plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1068
diff changeset
1708 * @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
1709 * 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
1710 * @ingroup Orthanc
1069
a91b4900f06a plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1068
diff changeset
1711 **/
a91b4900f06a plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1068
diff changeset
1712 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudyWithAccessionNumber(
a91b4900f06a plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1068
diff changeset
1713 OrthancPluginContext* context,
a91b4900f06a plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1068
diff changeset
1714 const char* accessionNumber)
a91b4900f06a plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1068
diff changeset
1715 {
a91b4900f06a plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1068
diff changeset
1716 char* result;
a91b4900f06a plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1068
diff changeset
1717
1145
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
1718 _OrthancPluginRetrieveDynamicString params;
1069
a91b4900f06a plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1068
diff changeset
1719 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
1720 params.argument = accessionNumber;
1069
a91b4900f06a plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1068
diff changeset
1721
1599
dd1f9e81f891 fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
1722 if (context->InvokeService(context, _OrthancPluginService_LookupStudyWithAccessionNumber, &params) != OrthancPluginErrorCode_Success)
1069
a91b4900f06a plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1068
diff changeset
1723 {
a91b4900f06a plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1068
diff changeset
1724 /* Error */
a91b4900f06a plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1068
diff changeset
1725 return NULL;
a91b4900f06a plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1068
diff changeset
1726 }
a91b4900f06a plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1068
diff changeset
1727 else
a91b4900f06a plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1068
diff changeset
1728 {
a91b4900f06a plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1068
diff changeset
1729 return result;
a91b4900f06a plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1068
diff changeset
1730 }
a91b4900f06a plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1068
diff changeset
1731 }
a91b4900f06a plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1068
diff changeset
1732
a91b4900f06a plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1068
diff changeset
1733
a91b4900f06a plugin lookup using accession number
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1068
diff changeset
1734 /**
1037
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1735 * @brief Look for a series.
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1736 *
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1737 * 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
1738 * 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
1739 * over all the stored series).
1037
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1740 *
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1741 * @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
1742 * @param seriesUID The Series Instance UID of interest.
1068
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
1743 * @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
1744 * 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
1745 * @ingroup Orthanc
1037
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1746 **/
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1747 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupSeries(
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1748 OrthancPluginContext* context,
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1749 const char* seriesUID)
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1750 {
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1751 char* result;
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1752
1145
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
1753 _OrthancPluginRetrieveDynamicString params;
1037
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1754 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
1755 params.argument = seriesUID;
1037
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1756
1599
dd1f9e81f891 fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
1757 if (context->InvokeService(context, _OrthancPluginService_LookupSeries, &params) != OrthancPluginErrorCode_Success)
1037
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1758 {
1067
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
1759 /* Error */
1037
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1760 return NULL;
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1761 }
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1762 else
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1763 {
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1764 return result;
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1765 }
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1766 }
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1767
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1768
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1769 /**
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1770 * @brief Look for an instance.
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1771 *
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1772 * 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
1773 * 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
1774 * over all the stored instances).
1037
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1775 *
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1776 * @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
1777 * @param sopInstanceUID The SOP Instance UID of interest.
1068
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
1778 * @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
1779 * 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
1780 * @ingroup Orthanc
1037
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1781 **/
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1782 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupInstance(
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1783 OrthancPluginContext* context,
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1784 const char* sopInstanceUID)
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1785 {
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1786 char* result;
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1787
1145
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
1788 _OrthancPluginRetrieveDynamicString params;
1037
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1789 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
1790 params.argument = sopInstanceUID;
1037
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1791
1599
dd1f9e81f891 fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
1792 if (context->InvokeService(context, _OrthancPluginService_LookupInstance, &params) != OrthancPluginErrorCode_Success)
1037
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1793 {
1067
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
1794 /* Error */
1037
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1795 return NULL;
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1796 }
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1797 else
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1798 {
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1799 return result;
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1800 }
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1801 }
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1802
6208ab500ffd LookupResource service in plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1027
diff changeset
1803
1042
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1804
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1805 typedef struct
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1806 {
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1807 OrthancPluginRestOutput* output;
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1808 uint16_t status;
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1809 } _OrthancPluginSendHttpStatusCode;
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1810
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1811 /**
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1812 * @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
1813 *
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1814 * 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
1815 * 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
1816 * - 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
1817 * - 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
1818 * - 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
1819 * - 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
1820 *
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1821 * @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
1822 * @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
1823 * @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
1824 * @ingroup REST
1594
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
1825 * @see OrthancPluginSendHttpStatus()
1042
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1826 **/
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1827 ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatusCode(
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1828 OrthancPluginContext* context,
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1829 OrthancPluginRestOutput* output,
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1830 uint16_t status)
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1831 {
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1832 _OrthancPluginSendHttpStatusCode params;
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1833 params.output = output;
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1834 params.status = status;
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1835 context->InvokeService(context, _OrthancPluginService_SendHttpStatusCode, &params);
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1836 }
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1837
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1838
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1839 /**
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1840 * @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
1841 *
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1842 * 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
1843 * not authorized.
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1844 *
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1845 * @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
1846 * @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
1847 * @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
1848 * @ingroup REST
1042
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1849 **/
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1850 ORTHANC_PLUGIN_INLINE void OrthancPluginSendUnauthorized(
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1851 OrthancPluginContext* context,
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1852 OrthancPluginRestOutput* output,
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1853 const char* realm)
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1854 {
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1855 _OrthancPluginOutputPlusArgument params;
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1856 params.output = output;
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1857 params.argument = realm;
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1858 context->InvokeService(context, _OrthancPluginService_SendUnauthorized, &params);
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1859 }
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1860
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1861
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1862 /**
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1863 * @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
1864 *
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1865 * 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
1866 * 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
1867 *
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1868 * @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
1869 * @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
1870 * @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
1871 * @ingroup REST
1042
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1872 **/
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1873 ORTHANC_PLUGIN_INLINE void OrthancPluginSendMethodNotAllowed(
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1874 OrthancPluginContext* context,
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1875 OrthancPluginRestOutput* output,
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1876 const char* allowedMethods)
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1877 {
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1878 _OrthancPluginOutputPlusArgument params;
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1879 params.output = output;
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1880 params.argument = allowedMethods;
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1881 context->InvokeService(context, _OrthancPluginService_SendMethodNotAllowed, &params);
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1882 }
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1883
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1884
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1885 typedef struct
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1886 {
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1887 OrthancPluginRestOutput* output;
1137
d9c27f9f1a51 OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1136
diff changeset
1888 const char* key;
1042
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1889 const char* value;
1137
d9c27f9f1a51 OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1136
diff changeset
1890 } _OrthancPluginSetHttpHeader;
1042
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1891
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1892 /**
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1893 * @brief Set a cookie.
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1894 *
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1895 * 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
1896 *
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1897 * @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
1898 * @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
1899 * @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
1900 * @param value The value of the cookie.
1601
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
1901 * @ingroup REST
1042
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1902 **/
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1903 ORTHANC_PLUGIN_INLINE void OrthancPluginSetCookie(
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1904 OrthancPluginContext* context,
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1905 OrthancPluginRestOutput* output,
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1906 const char* cookie,
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1907 const char* value)
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1908 {
1137
d9c27f9f1a51 OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1136
diff changeset
1909 _OrthancPluginSetHttpHeader params;
1042
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1910 params.output = output;
1137
d9c27f9f1a51 OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1136
diff changeset
1911 params.key = cookie;
1042
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1912 params.value = value;
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1913 context->InvokeService(context, _OrthancPluginService_SetCookie, &params);
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1914 }
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1915
8d1845feb277 set cookies, not allowed methods, unauthorized in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1041
diff changeset
1916
1137
d9c27f9f1a51 OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1136
diff changeset
1917 /**
d9c27f9f1a51 OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1136
diff changeset
1918 * @brief Set some HTTP header.
d9c27f9f1a51 OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1136
diff changeset
1919 *
d9c27f9f1a51 OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1136
diff changeset
1920 * This function sets a HTTP header in the HTTP answer.
d9c27f9f1a51 OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1136
diff changeset
1921 *
d9c27f9f1a51 OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1136
diff changeset
1922 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
d9c27f9f1a51 OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1136
diff changeset
1923 * @param output The HTTP connection to the client application.
d9c27f9f1a51 OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1136
diff changeset
1924 * @param key The HTTP header to be set.
d9c27f9f1a51 OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1136
diff changeset
1925 * @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
1926 * @ingroup REST
1137
d9c27f9f1a51 OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1136
diff changeset
1927 **/
d9c27f9f1a51 OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1136
diff changeset
1928 ORTHANC_PLUGIN_INLINE void OrthancPluginSetHttpHeader(
d9c27f9f1a51 OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1136
diff changeset
1929 OrthancPluginContext* context,
d9c27f9f1a51 OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1136
diff changeset
1930 OrthancPluginRestOutput* output,
d9c27f9f1a51 OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1136
diff changeset
1931 const char* key,
d9c27f9f1a51 OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1136
diff changeset
1932 const char* value)
d9c27f9f1a51 OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1136
diff changeset
1933 {
d9c27f9f1a51 OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1136
diff changeset
1934 _OrthancPluginSetHttpHeader params;
d9c27f9f1a51 OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1136
diff changeset
1935 params.output = output;
d9c27f9f1a51 OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1136
diff changeset
1936 params.key = key;
d9c27f9f1a51 OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1136
diff changeset
1937 params.value = value;
d9c27f9f1a51 OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1136
diff changeset
1938 context->InvokeService(context, _OrthancPluginService_SetHttpHeader, &params);
d9c27f9f1a51 OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1136
diff changeset
1939 }
d9c27f9f1a51 OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1136
diff changeset
1940
d9c27f9f1a51 OrthancPluginSetHttpHeader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1136
diff changeset
1941
1066
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1942 typedef struct
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1943 {
1815
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
1944 char** resultStringToFree;
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
1945 const char** resultString;
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
1946 int64_t* resultInt64;
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
1947 const char* key;
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
1948 OrthancPluginDicomInstance* instance;
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
1949 OrthancPluginInstanceOrigin* resultOrigin; /* New in Orthanc 0.9.5 SDK */
1066
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1950 } _OrthancPluginAccessDicomInstance;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1951
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1952
1068
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
1953 /**
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
1954 * @brief Get the AET of a DICOM instance.
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
1955 *
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
1956 * 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
1957 * DICOM modality from which a DICOM instance originates.
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
1958 *
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
1959 * @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
1960 * @param instance The instance of interest.
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
1961 * @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
1962 * @ingroup Callbacks
1068
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
1963 **/
1066
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1964 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceRemoteAet(
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1965 OrthancPluginContext* context,
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1966 OrthancPluginDicomInstance* instance)
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1967 {
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1968 const char* result;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1969
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1970 _OrthancPluginAccessDicomInstance params;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1971 memset(&params, 0, sizeof(params));
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1972 params.resultString = &result;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1973 params.instance = instance;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1974
1599
dd1f9e81f891 fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
1975 if (context->InvokeService(context, _OrthancPluginService_GetInstanceRemoteAet, &params) != OrthancPluginErrorCode_Success)
1066
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1976 {
1067
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
1977 /* Error */
1066
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1978 return NULL;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1979 }
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1980 else
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1981 {
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1982 return result;
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
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1986
1068
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
1987 /**
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
1988 * @brief Get the size of a DICOM file.
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
1989 *
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
1990 * 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
1991 *
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
1992 * @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
1993 * @param instance The instance of interest.
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
1994 * @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
1995 * @ingroup Callbacks
1068
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
1996 **/
1066
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1997 ORTHANC_PLUGIN_INLINE int64_t OrthancPluginGetInstanceSize(
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1998 OrthancPluginContext* context,
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
1999 OrthancPluginDicomInstance* instance)
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2000 {
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2001 int64_t size;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2002
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2003 _OrthancPluginAccessDicomInstance params;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2004 memset(&params, 0, sizeof(params));
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2005 params.resultInt64 = &size;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2006 params.instance = instance;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2007
1599
dd1f9e81f891 fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
2008 if (context->InvokeService(context, _OrthancPluginService_GetInstanceSize, &params) != OrthancPluginErrorCode_Success)
1066
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2009 {
1067
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2010 /* Error */
1066
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2011 return -1;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2012 }
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2013 else
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2014 {
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2015 return size;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2016 }
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2017 }
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2018
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2019
1068
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2020 /**
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2021 * @brief Get the data of a DICOM file.
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2022 *
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2023 * 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
2024 *
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2025 * @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
2026 * @param instance The instance of interest.
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2027 * @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
2028 * @ingroup Callbacks
1068
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2029 **/
1066
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2030 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceData(
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2031 OrthancPluginContext* context,
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2032 OrthancPluginDicomInstance* instance)
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2033 {
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2034 const char* result;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2035
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2036 _OrthancPluginAccessDicomInstance params;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2037 memset(&params, 0, sizeof(params));
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2038 params.resultString = &result;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2039 params.instance = instance;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2040
1599
dd1f9e81f891 fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
2041 if (context->InvokeService(context, _OrthancPluginService_GetInstanceData, &params) != OrthancPluginErrorCode_Success)
1066
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2042 {
1067
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2043 /* Error */
1066
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2044 return NULL;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2045 }
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2046 else
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2047 {
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2048 return result;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2049 }
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2050 }
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2051
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2052
1068
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2053 /**
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2054 * @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
2055 *
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2056 * 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
2057 * 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
2058 * of the given DICOM instance.
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2059 *
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2060 * @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
2061 * @param instance The instance of interest.
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2062 * @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
2063 * This string must be freed by OrthancPluginFreeString().
1601
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
2064 * @ingroup Callbacks
1068
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2065 **/
1066
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2066 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceJson(
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2067 OrthancPluginContext* context,
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2068 OrthancPluginDicomInstance* instance)
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2069 {
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2070 char* result;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2071
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2072 _OrthancPluginAccessDicomInstance params;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2073 memset(&params, 0, sizeof(params));
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2074 params.resultStringToFree = &result;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2075 params.instance = instance;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2076
1599
dd1f9e81f891 fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
2077 if (context->InvokeService(context, _OrthancPluginService_GetInstanceJson, &params) != OrthancPluginErrorCode_Success)
1066
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2078 {
1067
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2079 /* Error */
1066
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2080 return NULL;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2081 }
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2082 else
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2083 {
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2084 return result;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2085 }
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2086 }
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2087
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2088
1068
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2089 /**
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2090 * @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
2091 *
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2092 * 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
2093 * 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
2094 * of the given DICOM instance. In contrast with
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2095 * ::OrthancPluginGetInstanceJson(), the returned JSON file is in
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2096 * its simplified version.
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2097 *
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2098 * @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
2099 * @param instance The instance of interest.
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2100 * @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
2101 * This string must be freed by OrthancPluginFreeString().
1601
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
2102 * @ingroup Callbacks
1068
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2103 **/
1066
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2104 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceSimplifiedJson(
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2105 OrthancPluginContext* context,
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2106 OrthancPluginDicomInstance* instance)
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2107 {
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2108 char* result;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2109
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2110 _OrthancPluginAccessDicomInstance params;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2111 memset(&params, 0, sizeof(params));
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2112 params.resultStringToFree = &result;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2113 params.instance = instance;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2114
1599
dd1f9e81f891 fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
2115 if (context->InvokeService(context, _OrthancPluginService_GetInstanceSimplifiedJson, &params) != OrthancPluginErrorCode_Success)
1066
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2116 {
1067
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2117 /* Error */
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2118 return NULL;
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2119 }
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2120 else
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2121 {
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2122 return result;
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2123 }
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2124 }
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2125
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2126
1068
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2127 /**
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2128 * @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
2129 *
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2130 * 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
2131 * 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
2132 * callbacks registered by
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2133 * ::OrthancPluginRegisterOnStoredInstanceCallback(), the only
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2134 * possibly available metadata are "ReceptionDate", "RemoteAET" and
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2135 * "IndexInSeries".
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2136 *
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2137 * @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
2138 * @param instance The instance of interest.
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2139 * @param metadata The metadata of interest.
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2140 * @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
2141 * @ingroup Callbacks
1068
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2142 **/
1067
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2143 ORTHANC_PLUGIN_INLINE int OrthancPluginHasInstanceMetadata(
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2144 OrthancPluginContext* context,
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2145 OrthancPluginDicomInstance* instance,
1068
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2146 const char* metadata)
1067
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2147 {
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2148 int64_t result;
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2149
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2150 _OrthancPluginAccessDicomInstance params;
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2151 memset(&params, 0, sizeof(params));
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2152 params.resultInt64 = &result;
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2153 params.instance = instance;
1068
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2154 params.key = metadata;
1067
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2155
1599
dd1f9e81f891 fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
2156 if (context->InvokeService(context, _OrthancPluginService_HasInstanceMetadata, &params) != OrthancPluginErrorCode_Success)
1067
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2157 {
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2158 /* Error */
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2159 return -1;
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2160 }
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2161 else
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2162 {
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2163 return (result != 0);
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2164 }
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2165 }
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2166
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2167
1068
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2168 /**
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2169 * @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
2170 *
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2171 * 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
2172 * 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
2173 * ::OrthancPluginHasInstanceMetadata().
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2174 *
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2175 * @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
2176 * @param instance The instance of interest.
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2177 * @param metadata The metadata of interest.
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2178 * @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
2179 * @ingroup Callbacks
1068
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2180 **/
1067
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2181 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceMetadata(
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2182 OrthancPluginContext* context,
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2183 OrthancPluginDicomInstance* instance,
1068
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2184 const char* metadata)
1067
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2185 {
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2186 const char* result;
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2187
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2188 _OrthancPluginAccessDicomInstance params;
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2189 memset(&params, 0, sizeof(params));
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2190 params.resultString = &result;
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2191 params.instance = instance;
1068
f54a9c6fea5d documentation of plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1067
diff changeset
2192 params.key = metadata;
1067
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2193
1599
dd1f9e81f891 fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
2194 if (context->InvokeService(context, _OrthancPluginService_GetInstanceMetadata, &params) != OrthancPluginErrorCode_Success)
1067
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2195 {
ace99e272203 access metadata in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1066
diff changeset
2196 /* Error */
1066
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2197 return NULL;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2198 }
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2199 else
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2200 {
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2201 return result;
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2202 }
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2203 }
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2204
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2205
bb82e5e818e9 OnStoredInstance callback in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1042
diff changeset
2206
1135
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
2207 typedef struct
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
2208 {
1295
50632b89e294 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
2209 OrthancPluginStorageCreate create;
50632b89e294 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
2210 OrthancPluginStorageRead read;
50632b89e294 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
2211 OrthancPluginStorageRemove remove;
50632b89e294 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
2212 OrthancPluginFree free;
1135
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
2213 } _OrthancPluginRegisterStorageArea;
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
2214
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
2215 /**
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
2216 * @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
2217 *
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
2218 * 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
2219 * 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
2220 * 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
2221 * 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
2222 *
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
2223 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1141
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1137
diff changeset
2224 * @param create The callback function to store a file on the custom storage area.
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1137
diff changeset
2225 * @param read The callback function to read a file from the custom storage area.
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1137
diff changeset
2226 * @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
2227 * @ingroup Callbacks
1135
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
2228 **/
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
2229 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
2230 OrthancPluginContext* context,
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
2231 OrthancPluginStorageCreate create,
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
2232 OrthancPluginStorageRead read,
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
2233 OrthancPluginStorageRemove remove)
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
2234 {
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
2235 _OrthancPluginRegisterStorageArea params;
1295
50632b89e294 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
2236 params.create = create;
50632b89e294 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
2237 params.read = read;
50632b89e294 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
2238 params.remove = remove;
1136
208dc67b9bab sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1135
diff changeset
2239
208dc67b9bab sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1135
diff changeset
2240 #ifdef __cplusplus
1295
50632b89e294 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
2241 params.free = ::free;
1136
208dc67b9bab sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1135
diff changeset
2242 #else
1295
50632b89e294 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
2243 params.free = free;
1136
208dc67b9bab sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1135
diff changeset
2244 #endif
208dc67b9bab sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1135
diff changeset
2245
1135
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
2246 context->InvokeService(context, _OrthancPluginService_RegisterStorageArea, &params);
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
2247 }
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
2248
67c3c1e4a6e0 index-only mode, and custom storage area with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1069
diff changeset
2249
1145
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2250
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2251 /**
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2252 * @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
2253 *
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2254 * 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
2255 *
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2256 * @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
2257 * @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
2258 * 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
2259 * OrthancPluginFreeString().
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2260 **/
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2261 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
2262 {
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2263 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
2264
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2265 _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
2266 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
2267 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
2268
1599
dd1f9e81f891 fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
2269 if (context->InvokeService(context, _OrthancPluginService_GetOrthancPath, &params) != 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
2270 {
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2271 /* Error */
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2272 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
2273 }
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2274 else
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2275 {
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2276 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
2277 }
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2278 }
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2279
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2280
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2281 /**
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2282 * @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
2283 *
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2284 * 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
2285 *
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2286 * @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
2287 * @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
2288 * 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
2289 * OrthancPluginFreeString().
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2290 **/
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2291 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
2292 {
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2293 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
2294
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2295 _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
2296 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
2297 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
2298
1599
dd1f9e81f891 fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
2299 if (context->InvokeService(context, _OrthancPluginService_GetOrthancDirectory, &params) != 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
2300 {
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2301 /* Error */
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2302 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
2303 }
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2304 else
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2305 {
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2306 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
2307 }
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2308 }
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2309
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2310
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2311 /**
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
2312 * @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
2313 *
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
2314 * 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
2315 * 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
2316 * 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
2317 * files. This function is deprecated in favor of
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2318 * 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
2319 *
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2320 * @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
2321 * @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
2322 * 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
2323 * OrthancPluginFreeString().
1424
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2324 * @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
2325 **/
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2326 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
2327 {
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2328 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
2329
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2330 _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
2331 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
2332 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
2333
1599
dd1f9e81f891 fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
2334 if (context->InvokeService(context, _OrthancPluginService_GetConfigurationPath, &params) != 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
2335 {
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2336 /* Error */
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2337 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
2338 }
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2339 else
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2340 {
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2341 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
2342 }
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2343 }
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2344
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2345
0479d02c6778 Plugins can retrieve the path to Orthanc and to its configuration file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1141
diff changeset
2346
1177
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
2347 typedef struct
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
2348 {
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
2349 OrthancPluginOnChangeCallback callback;
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
2350 } _OrthancPluginOnChangeCallback;
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
2351
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
2352 /**
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
2353 * @brief Register a callback to monitor changes.
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
2354 *
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
2355 * 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
2356 * whenever a change happens to some DICOM resource.
1642
0669d05b6de1 warning about OrthancPluginRegisterOnChangeCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
2357 *
0669d05b6de1 warning about OrthancPluginRegisterOnChangeCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
2358 * @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
2359 * 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
2360 * the events passing through a message queue). Otherwise, this
0669d05b6de1 warning about OrthancPluginRegisterOnChangeCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
2361 * 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
2362 * script.
1177
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
2363 *
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
2364 * @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
2365 * @param callback The callback function.
1601
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
2366 * @ingroup Callbacks
1177
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
2367 **/
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
2368 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnChangeCallback(
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
2369 OrthancPluginContext* context,
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
2370 OrthancPluginOnChangeCallback callback)
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
2371 {
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
2372 _OrthancPluginOnChangeCallback params;
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
2373 params.callback = callback;
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
2374
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
2375 context->InvokeService(context, _OrthancPluginService_RegisterOnChangeCallback, &params);
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
2376 }
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
2377
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
2378
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
2379
1232
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
2380 typedef struct
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
2381 {
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
2382 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
2383 _OrthancPluginProperty property;
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
2384 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
2385 } _OrthancPluginSetPluginProperty;
1232
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
2386
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
2387
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
2388 /**
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
2389 * @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
2390 *
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
2391 * 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
2392 * 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
2393 * 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
2394 * Explorer.
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
2395 *
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
2396 * @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
2397 * @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
2398 **/
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
2399 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
2400 OrthancPluginContext* context,
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
2401 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
2402 {
1249
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2403 _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
2404 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
2405 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
2406 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
2407
1249
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2408 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
1232
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
2409 }
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
2410
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
2411
1233
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1232
diff changeset
2412 /**
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1232
diff changeset
2413 * @brief Set a description for this plugin.
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1232
diff changeset
2414 *
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1232
diff changeset
2415 * Set a description for this plugin. It is displayed in the
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1232
diff changeset
2416 * "Plugins" page of Orthanc Explorer.
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1232
diff changeset
2417 *
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1232
diff changeset
2418 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1232
diff changeset
2419 * @param description The description.
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1232
diff changeset
2420 **/
1232
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
2421 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
2422 OrthancPluginContext* context,
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
2423 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
2424 {
1249
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2425 _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
2426 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
2427 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
2428 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
2429
1249
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2430 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
1232
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
2431 }
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
2432
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
2433
1233
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1232
diff changeset
2434 /**
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1232
diff changeset
2435 * @brief Extend the JavaScript code of Orthanc Explorer.
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1232
diff changeset
2436 *
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1232
diff changeset
2437 * Add JavaScript code to customize the default behavior of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1232
diff changeset
2438 * Explorer. This can for instance be used to add new buttons.
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1232
diff changeset
2439 *
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1232
diff changeset
2440 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1232
diff changeset
2441 * @param javascript The custom JavaScript code.
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1232
diff changeset
2442 **/
1232
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
2443 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
2444 OrthancPluginContext* context,
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
2445 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
2446 {
1249
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2447 _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
2448 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
2449 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
2450 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
2451
1249
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2452 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
1232
f1c01451a8ee Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1198
diff changeset
2453 }
1177
5b2d8c280ac2 Plugins can monitor changes through callbacks
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1145
diff changeset
2454
1249
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2455
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2456 typedef struct
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2457 {
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2458 char** result;
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2459 int32_t property;
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2460 const char* value;
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2461 } _OrthancPluginGlobalProperty;
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2462
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2463
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2464 /**
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2465 * @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
2466 *
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2467 * 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
2468 * 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
2469 *
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2470 * @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
2471 * @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
2472 * @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
2473 * @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
2474 * string must be freed by OrthancPluginFreeString().
1601
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
2475 * @ingroup Orthanc
1249
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2476 **/
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2477 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
2478 OrthancPluginContext* context,
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2479 int32_t property,
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2480 const char* defaultValue)
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2481 {
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2482 char* result;
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2483
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2484 _OrthancPluginGlobalProperty params;
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2485 params.result = &result;
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2486 params.property = property;
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2487 params.value = defaultValue;
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
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_GetGlobalProperty, &params) != OrthancPluginErrorCode_Success)
1249
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2490 {
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2491 /* Error */
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2492 return NULL;
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2493 }
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2494 else
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2495 {
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2496 return result;
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2497 }
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2498 }
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2499
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2500
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2501 /**
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2502 * @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
2503 *
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2504 * 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
2505 * 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
2506 * 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
2507 * 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
2508 * 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
2509 *
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2510 * @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
2511 * @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
2512 * @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
2513 * @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
2514 * @ingroup Orthanc
1249
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2515 **/
1581
357c4bb15701 Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1580
diff changeset
2516 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
2517 OrthancPluginContext* context,
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2518 int32_t property,
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2519 const char* value)
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2520 {
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2521 _OrthancPluginGlobalProperty params;
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2522 params.result = NULL;
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2523 params.property = property;
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2524 params.value = value;
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2525
1581
357c4bb15701 Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1580
diff changeset
2526 return context->InvokeService(context, _OrthancPluginService_SetGlobalProperty, &params);
1249
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2527 }
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2528
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2529
40725595aaf0 Plugins can get/set global properties to save their configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1233
diff changeset
2530
1280
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2531 typedef struct
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2532 {
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2533 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
2534 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
2535 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
2536 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
2537 } _OrthancPluginReturnSingleValue;
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2538
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2539 /**
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2540 * @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
2541 *
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2542 * 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
2543 *
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2544 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2545 * @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
2546 **/
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2547 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
2548 OrthancPluginContext* context)
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2549 {
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2550 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
2551
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2552 _OrthancPluginReturnSingleValue params;
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2553 memset(&params, 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
2554 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
2555
1599
dd1f9e81f891 fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
2556 if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgumentsCount, &params) != 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
2557 {
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2558 /* Error */
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2559 return 0;
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2560 }
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2561 else
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2562 {
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2563 return count;
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2564 }
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2565 }
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2566
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2567
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2568
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2569 /**
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2570 * @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
2571 *
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2572 * 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
2573 * 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
2574 * 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
2575 *
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2576 * @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
2577 * @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
2578 * @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
2579 * 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
2580 **/
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2581 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
2582 OrthancPluginContext* context,
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2583 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
2584 {
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2585 char* result;
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2586
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2587 _OrthancPluginGlobalProperty params;
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2588 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
2589 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
2590 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
2591
1599
dd1f9e81f891 fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
2592 if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgument, &params) != 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
2593 {
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2594 /* Error */
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2595 return NULL;
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2596 }
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2597 else
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2598 {
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2599 return result;
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2600 }
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2601 }
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2602
d6a65dc6d0ac Plugins can access the command-line arguments used to launch Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1249
diff changeset
2603
1407
d371a66972a4 OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1322
diff changeset
2604 /**
d371a66972a4 OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1322
diff changeset
2605 * @brief Get the expected version of the database schema.
d371a66972a4 OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1322
diff changeset
2606 *
d371a66972a4 OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1322
diff changeset
2607 * Retrieve the expected version of the database schema.
d371a66972a4 OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1322
diff changeset
2608 *
d371a66972a4 OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1322
diff changeset
2609 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
d371a66972a4 OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1322
diff changeset
2610 * @return The version.
1601
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
2611 * @ingroup Callbacks
1615
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
2612 * @deprecated Please instead use IDatabaseBackend::UpgradeDatabase()
1407
d371a66972a4 OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1322
diff changeset
2613 **/
d371a66972a4 OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1322
diff changeset
2614 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetExpectedDatabaseVersion(
d371a66972a4 OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1322
diff changeset
2615 OrthancPluginContext* context)
d371a66972a4 OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1322
diff changeset
2616 {
d371a66972a4 OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1322
diff changeset
2617 uint32_t count = 0;
d371a66972a4 OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1322
diff changeset
2618
d371a66972a4 OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1322
diff changeset
2619 _OrthancPluginReturnSingleValue params;
d371a66972a4 OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1322
diff changeset
2620 memset(&params, 0, sizeof(params));
d371a66972a4 OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1322
diff changeset
2621 params.resultUint32 = &count;
d371a66972a4 OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1322
diff changeset
2622
1599
dd1f9e81f891 fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
2623 if (context->InvokeService(context, _OrthancPluginService_GetExpectedDatabaseVersion, &params) != OrthancPluginErrorCode_Success)
1407
d371a66972a4 OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1322
diff changeset
2624 {
d371a66972a4 OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1322
diff changeset
2625 /* Error */
d371a66972a4 OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1322
diff changeset
2626 return 0;
d371a66972a4 OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1322
diff changeset
2627 }
d371a66972a4 OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1322
diff changeset
2628 else
d371a66972a4 OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1322
diff changeset
2629 {
d371a66972a4 OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1322
diff changeset
2630 return count;
d371a66972a4 OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1322
diff changeset
2631 }
d371a66972a4 OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1322
diff changeset
2632 }
d371a66972a4 OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1322
diff changeset
2633
d371a66972a4 OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1322
diff changeset
2634
d371a66972a4 OrthancPluginGetExpectedDatabaseVersion
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1322
diff changeset
2635
1424
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2636 /**
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2637 * @brief Return the content of the configuration file(s).
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2638 *
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2639 * This function returns the content of the configuration that is
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2640 * used by Orthanc, formatted as a JSON string.
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2641 *
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2642 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2643 * @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
2644 * containing the configuration. This string must be freed by
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2645 * OrthancPluginFreeString().
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2646 **/
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2647 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfiguration(OrthancPluginContext* context)
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2648 {
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2649 char* result;
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2650
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2651 _OrthancPluginRetrieveDynamicString params;
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2652 params.result = &result;
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2653 params.argument = NULL;
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2654
1599
dd1f9e81f891 fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
2655 if (context->InvokeService(context, _OrthancPluginService_GetConfiguration, &params) != OrthancPluginErrorCode_Success)
1424
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2656 {
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2657 /* Error */
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2658 return NULL;
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2659 }
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2660 else
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2661 {
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2662 return result;
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2663 }
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2664 }
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2665
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2666
fe384a9d3b51 OrthancPluginGetConfiguration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1423
diff changeset
2667
1430
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2668 typedef struct
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2669 {
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2670 OrthancPluginRestOutput* output;
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2671 const char* subType;
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2672 const char* contentType;
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2673 } _OrthancPluginStartMultipartAnswer;
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2674
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2675 /**
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2676 * @brief Start an HTTP multipart answer.
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2677 *
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2678 * 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
2679 *
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2680 * @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
2681 * @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
2682 * @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
2683 * @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
2684 * @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
2685 * @see OrthancPluginSendMultipartItem()
1601
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
2686 * @ingroup REST
1430
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2687 **/
1581
357c4bb15701 Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1580
diff changeset
2688 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStartMultipartAnswer(
1430
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2689 OrthancPluginContext* context,
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2690 OrthancPluginRestOutput* output,
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2691 const char* subType,
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2692 const char* contentType)
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2693 {
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2694 _OrthancPluginStartMultipartAnswer params;
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2695 params.output = output;
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2696 params.subType = subType;
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2697 params.contentType = contentType;
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2698 return context->InvokeService(context, _OrthancPluginService_StartMultipartAnswer, &params);
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2699 }
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2700
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2701
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2702 /**
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2703 * @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
2704 *
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2705 * 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
2706 * answer that was initiated by OrthancPluginStartMultipartAnswer().
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2707 *
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2708 * @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
2709 * @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
2710 * @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
2711 * @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
2712 * @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
2713 * 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
2714 * @ingroup REST
1430
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2715 **/
1581
357c4bb15701 Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1580
diff changeset
2716 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSendMultipartItem(
1430
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2717 OrthancPluginContext* context,
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2718 OrthancPluginRestOutput* output,
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2719 const char* answer,
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2720 uint32_t answerSize)
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2721 {
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2722 _OrthancPluginAnswerBuffer params;
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2723 params.output = output;
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2724 params.answer = answer;
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2725 params.answerSize = answerSize;
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2726 params.mimeType = NULL;
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2727 return context->InvokeService(context, _OrthancPluginService_SendMultipartItem, &params);
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2728 }
ad94a3583b07 Plugins can send answers as multipart messages
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1426
diff changeset
2729
1554
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2730
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2731
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2732 typedef struct
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2733 {
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2734 OrthancPluginMemoryBuffer* target;
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2735 const void* source;
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2736 uint32_t size;
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2737 OrthancPluginCompressionType compression;
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2738 uint8_t uncompress;
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2739 } _OrthancPluginBufferCompression;
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2740
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2741
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2742 /**
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2743 * @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
2744 *
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2745 * 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
2746 * 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
2747 *
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2748 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1821
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
2749 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
1554
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2750 * @param source The source buffer.
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2751 * @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
2752 * @param compression The compression algorithm.
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2753 * @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
2754 * 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
2755 * @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
2756 * @ingroup Images
1554
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2757 **/
1581
357c4bb15701 Plugins have access to explicit error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1580
diff changeset
2758 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
2759 OrthancPluginContext* context,
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2760 OrthancPluginMemoryBuffer* target,
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2761 const void* source,
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2762 uint32_t size,
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2763 OrthancPluginCompressionType compression,
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2764 uint8_t uncompress)
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2765 {
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2766 _OrthancPluginBufferCompression params;
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2767 params.target = target;
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2768 params.source = source;
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2769 params.size = size;
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2770 params.compression = compression;
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2771 params.uncompress = uncompress;
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2772
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2773 return context->InvokeService(context, _OrthancPluginService_BufferCompression, &params);
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2774 }
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2775
89ab71a68fcf New function OrthancPluginBufferCompression() to (un)compress memory buffers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1466
diff changeset
2776
1588
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2777
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2778 typedef struct
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2779 {
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2780 OrthancPluginMemoryBuffer* target;
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2781 const char* path;
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2782 } _OrthancPluginReadFile;
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2783
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2784 /**
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2785 * @brief Read a file.
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2786 *
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2787 * 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
2788 * a newly allocated memory buffer.
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2789 *
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2790 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1821
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
2791 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
1588
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2792 * @param path The path of the file to be read.
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2793 * @return 0 if success, or the error code if failure.
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2794 **/
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2795 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginReadFile(
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2796 OrthancPluginContext* context,
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2797 OrthancPluginMemoryBuffer* target,
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2798 const char* path)
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2799 {
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2800 _OrthancPluginReadFile params;
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2801 params.target = target;
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2802 params.path = path;
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2803 return context->InvokeService(context, _OrthancPluginService_ReadFile, &params);
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2804 }
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2805
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2806
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2807
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2808 typedef struct
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2809 {
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2810 const char* path;
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2811 const void* data;
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2812 uint32_t size;
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2813 } _OrthancPluginWriteFile;
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2814
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2815 /**
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2816 * @brief Write a file.
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2817 *
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2818 * Write the content of a memory buffer to the filesystem.
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2819 *
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2820 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2821 * @param path The path of the file to be written.
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2822 * @param data The content of the memory buffer.
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2823 * @param size The size of the memory buffer.
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2824 * @return 0 if success, or the error code if failure.
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2825 **/
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2826 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWriteFile(
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2827 OrthancPluginContext* context,
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2828 const char* path,
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2829 const void* data,
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2830 uint32_t size)
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2831 {
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2832 _OrthancPluginWriteFile params;
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2833 params.path = path;
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2834 params.data = data;
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2835 params.size = size;
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2836 return context->InvokeService(context, _OrthancPluginService_WriteFile, &params);
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2837 }
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2838
b5bc87a7212d OrthancPluginReadFile, OrthancPluginWriteFile
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1583
diff changeset
2839
1593
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2840
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2841 typedef struct
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2842 {
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2843 const char** target;
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2844 OrthancPluginErrorCode error;
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2845 } _OrthancPluginGetErrorDescription;
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2846
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2847 /**
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2848 * @brief Get the description of a given error code.
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2849 *
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2850 * This function returns the description of a given error code.
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2851 *
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2852 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1595
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
2853 * @param error The error code of interest.
1593
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2854 * @return The error description. This is a statically-allocated
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2855 * string, do not free it.
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2856 **/
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2857 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetErrorDescription(
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2858 OrthancPluginContext* context,
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2859 OrthancPluginErrorCode error)
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2860 {
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2861 const char* result = NULL;
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2862
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2863 _OrthancPluginGetErrorDescription params;
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2864 params.target = &result;
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2865 params.error = error;
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2866
1599
dd1f9e81f891 fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
2867 if (context->InvokeService(context, _OrthancPluginService_GetErrorDescription, &params) != OrthancPluginErrorCode_Success ||
1593
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2868 result == NULL)
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2869 {
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2870 return "Unknown error code";
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2871 }
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2872 else
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2873 {
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2874 return result;
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2875 }
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2876 }
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2877
235d89817b89 OrthancPluginGetErrorDescription
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1588
diff changeset
2878
1594
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2879
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2880 typedef struct
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2881 {
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2882 OrthancPluginRestOutput* output;
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2883 uint16_t status;
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2884 const char* body;
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2885 uint32_t bodySize;
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2886 } _OrthancPluginSendHttpStatus;
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2887
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2888 /**
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2889 * @brief Send a HTTP status, with a custom body.
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2890 *
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2891 * This function answers to a HTTP request by sending a HTTP status
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2892 * code (such as "400 - Bad Request"), together with a body
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2893 * describing the error. The body will only be returned if the
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2894 * configuration option "HttpDescribeErrors" of Orthanc is set to "true".
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2895 *
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2896 * Note that:
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2897 * - Successful requests (status 200) must use ::OrthancPluginAnswerBuffer().
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2898 * - Redirections (status 301) must use ::OrthancPluginRedirect().
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2899 * - Unauthorized access (status 401) must use ::OrthancPluginSendUnauthorized().
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2900 * - Methods not allowed (status 405) must use ::OrthancPluginSendMethodNotAllowed().
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2901 *
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2902 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2903 * @param output The HTTP connection to the client application.
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2904 * @param status The HTTP status code to be sent.
1595
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
2905 * @param body The body of the answer.
e1e54a73ba8b OrthancPluginRegisterRestCallbackNoLock, documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1594
diff changeset
2906 * @param bodySize The size of the body.
1594
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2907 * @see OrthancPluginSendHttpStatusCode()
1601
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
2908 * @ingroup REST
1594
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2909 **/
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2910 ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatus(
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2911 OrthancPluginContext* context,
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2912 OrthancPluginRestOutput* output,
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2913 uint16_t status,
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2914 const char* body,
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2915 uint32_t bodySize)
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2916 {
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2917 _OrthancPluginSendHttpStatus params;
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2918 params.output = output;
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2919 params.status = status;
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2920 params.body = body;
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2921 params.bodySize = bodySize;
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2922 context->InvokeService(context, _OrthancPluginService_SendHttpStatus, &params);
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2923 }
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2924
2bac60a4f584 OrthancPluginSendHttpStatus
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1593
diff changeset
2925
1598
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2926
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2927 typedef struct
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 const OrthancPluginImage* image;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2930 uint32_t* resultUint32;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2931 OrthancPluginPixelFormat* resultPixelFormat;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2932 const void** resultBuffer;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2933 } _OrthancPluginGetImageInfo;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2934
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2935
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
2936 /**
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
2937 * @brief Return the pixel format of an image.
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 * 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
2940 *
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
2941 * @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
2942 * @param image The image of interest.
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
2943 * @return The pixel format.
1613
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
2944 * @ingroup Images
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
2945 **/
1598
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2946 ORTHANC_PLUGIN_INLINE OrthancPluginPixelFormat OrthancPluginGetImagePixelFormat(
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2947 OrthancPluginContext* context,
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2948 const OrthancPluginImage* image)
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 OrthancPluginPixelFormat target;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2951
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2952 _OrthancPluginGetImageInfo params;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2953 memset(&params, 0, sizeof(params));
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2954 params.image = image;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2955 params.resultPixelFormat = &target;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2956
1599
dd1f9e81f891 fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
2957 if (context->InvokeService(context, _OrthancPluginService_GetImagePixelFormat, &params) != OrthancPluginErrorCode_Success)
1598
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 return OrthancPluginPixelFormat_Unknown;
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 else
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2962 {
1599
dd1f9e81f891 fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
2963 return (OrthancPluginPixelFormat) target;
1598
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
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2967
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2968
1600
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 * @brief Return the width of an image.
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
2971 *
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
2972 * This function returns the width of the given image.
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
2973 *
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
2974 * @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
2975 * @param image The image of interest.
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
2976 * @return The width.
1613
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
2977 * @ingroup Images
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
2978 **/
1598
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2979 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageWidth(
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2980 OrthancPluginContext* context,
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2981 const OrthancPluginImage* image)
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2982 {
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2983 uint32_t width;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2984
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2985 _OrthancPluginGetImageInfo params;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2986 memset(&params, 0, sizeof(params));
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 params.resultUint32 = &width;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2989
1599
dd1f9e81f891 fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
2990 if (context->InvokeService(context, _OrthancPluginService_GetImageWidth, &params) != OrthancPluginErrorCode_Success)
1598
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2991 {
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2992 return 0;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2993 }
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2994 else
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2995 {
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
2996 return width;
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
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3001
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3002 /**
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3003 * @brief Return the height of an image.
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3004 *
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3005 * This function returns the height of the given image.
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3006 *
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3007 * @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
3008 * @param image The image of interest.
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3009 * @return The height.
1613
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3010 * @ingroup Images
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3011 **/
1598
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3012 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageHeight(
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3013 OrthancPluginContext* context,
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3014 const OrthancPluginImage* image)
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3015 {
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3016 uint32_t height;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3017
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3018 _OrthancPluginGetImageInfo params;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3019 memset(&params, 0, sizeof(params));
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3020 params.image = image;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3021 params.resultUint32 = &height;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3022
1599
dd1f9e81f891 fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
3023 if (context->InvokeService(context, _OrthancPluginService_GetImageHeight, &params) != OrthancPluginErrorCode_Success)
1598
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3024 {
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3025 return 0;
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 else
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 return height;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3030 }
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3031 }
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3032
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3033
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3034
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3035 /**
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3036 * @brief Return the pitch of an image.
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3037 *
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3038 * 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
3039 * 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
3040 * image in the memory buffer.
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3041 *
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3042 * @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
3043 * @param image The image of interest.
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3044 * @return The pitch.
1613
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3045 * @ingroup Images
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3046 **/
1598
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3047 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImagePitch(
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3048 OrthancPluginContext* context,
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3049 const OrthancPluginImage* image)
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3050 {
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3051 uint32_t pitch;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3052
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3053 _OrthancPluginGetImageInfo params;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3054 memset(&params, 0, sizeof(params));
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3055 params.image = image;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3056 params.resultUint32 = &pitch;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3057
1599
dd1f9e81f891 fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
3058 if (context->InvokeService(context, _OrthancPluginService_GetImagePitch, &params) != OrthancPluginErrorCode_Success)
1598
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3059 {
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3060 return 0;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3061 }
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3062 else
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3063 {
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3064 return pitch;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3065 }
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3066 }
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3067
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3068
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3069
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3070 /**
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3071 * @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
3072 *
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3073 * 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
3074 * contains the pixels of the image.
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3075 *
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3076 * @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
3077 * @param image The image of interest.
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3078 * @return The pointer.
1613
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3079 * @ingroup Images
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3080 **/
1598
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3081 ORTHANC_PLUGIN_INLINE const void* OrthancPluginGetImageBuffer(
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3082 OrthancPluginContext* context,
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3083 const OrthancPluginImage* image)
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3084 {
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3085 const void* target = NULL;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3086
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3087 _OrthancPluginGetImageInfo params;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3088 memset(&params, 0, sizeof(params));
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3089 params.resultBuffer = &target;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3090 params.image = image;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3091
1599
dd1f9e81f891 fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
3092 if (context->InvokeService(context, _OrthancPluginService_GetImageBuffer, &params) != OrthancPluginErrorCode_Success)
1598
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3093 {
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3094 return NULL;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3095 }
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3096 else
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3097 {
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3098 return target;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3099 }
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3100 }
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3101
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3102
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3103 typedef struct
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3104 {
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3105 OrthancPluginImage** target;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3106 const void* data;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3107 uint32_t size;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3108 OrthancPluginImageFormat format;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3109 } _OrthancPluginUncompressImage;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3110
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3111
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3112 /**
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3113 * @brief Decode a compressed image.
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3114 *
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3115 * 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
3116 *
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3117 * @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
3118 * @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
3119 * @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
3120 * @param format The file format of the compressed image.
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3121 * @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
3122 * @ingroup Images
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3123 **/
1598
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3124 ORTHANC_PLUGIN_INLINE OrthancPluginImage *OrthancPluginUncompressImage(
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3125 OrthancPluginContext* context,
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3126 const void* data,
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3127 uint32_t size,
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3128 OrthancPluginImageFormat format)
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 OrthancPluginImage* target = NULL;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3131
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3132 _OrthancPluginUncompressImage params;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3133 memset(&params, 0, sizeof(params));
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3134 params.target = &target;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3135 params.data = data;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3136 params.size = size;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3137 params.format = format;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3138
1599
dd1f9e81f891 fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
3139 if (context->InvokeService(context, _OrthancPluginService_UncompressImage, &params) != OrthancPluginErrorCode_Success)
1598
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3140 {
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3141 return NULL;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3142 }
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3143 else
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3144 {
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3145 return target;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3146 }
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3147 }
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3148
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3149
1605
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1602
diff changeset
3150
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1602
diff changeset
3151
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1602
diff changeset
3152 typedef struct
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1602
diff changeset
3153 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1602
diff changeset
3154 OrthancPluginImage* image;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1602
diff changeset
3155 } _OrthancPluginFreeImage;
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1602
diff changeset
3156
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3157 /**
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3158 * @brief Free an image.
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3159 *
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3160 * 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
3161 *
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3162 * @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
3163 * @param image The image.
1613
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3164 * @ingroup Images
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3165 **/
1598
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3166 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeImage(
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3167 OrthancPluginContext* context,
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3168 OrthancPluginImage* image)
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3169 {
1605
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1602
diff changeset
3170 _OrthancPluginFreeImage params;
1598
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3171 params.image = image;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3172
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3173 context->InvokeService(context, _OrthancPluginService_FreeImage, &params);
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3174 }
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
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3179 typedef struct
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3180 {
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3181 OrthancPluginMemoryBuffer* target;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3182 OrthancPluginImageFormat imageFormat;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3183 OrthancPluginPixelFormat pixelFormat;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3184 uint32_t width;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3185 uint32_t height;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3186 uint32_t pitch;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3187 const void* buffer;
1599
dd1f9e81f891 fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
3188 uint8_t quality;
1598
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3189 } _OrthancPluginCompressImage;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3190
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3191
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3192 /**
1601
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
3193 * @brief Encode a PNG image.
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3194 *
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3195 * This function compresses the given memory buffer containing an
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3196 * 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
3197 * compression into a newly allocated memory buffer.
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3198 *
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3199 * @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
3200 * @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
3201 * @param format The memory layout of the uncompressed image.
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3202 * @param width The width of the image.
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3203 * @param height The height of the image.
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3204 * @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
3205 * 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
3206 * @param buffer The memory buffer containing the uncompressed image.
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3207 * @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
3208 * @see OrthancPluginCompressAndAnswerPngImage()
1613
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3209 * @ingroup Images
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3210 **/
1598
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3211 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCompressPngImage(
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3212 OrthancPluginContext* context,
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3213 OrthancPluginMemoryBuffer* target,
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3214 OrthancPluginPixelFormat format,
1598
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3215 uint32_t width,
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3216 uint32_t height,
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3217 uint32_t pitch,
1599
dd1f9e81f891 fixes to image primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
3218 const void* buffer)
1598
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3219 {
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3220 _OrthancPluginCompressImage params;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3221 memset(&params, 0, sizeof(params));
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3222 params.target = target;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3223 params.imageFormat = OrthancPluginImageFormat_Png;
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3224 params.pixelFormat = format;
1598
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3225 params.width = width;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3226 params.height = height;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3227 params.pitch = pitch;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3228 params.buffer = buffer;
1613
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3229 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
3230
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3231 return context->InvokeService(context, _OrthancPluginService_CompressImage, &params);
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3232 }
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3233
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3234
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3235 /**
1601
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
3236 * @brief Encode a JPEG image.
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3237 *
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3238 * This function compresses the given memory buffer containing an
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3239 * 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
3240 * compression into a newly allocated memory buffer.
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3241 *
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3242 * @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
3243 * @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
3244 * @param format The memory layout of the uncompressed image.
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3245 * @param width The width of the image.
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3246 * @param height The height of the image.
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3247 * @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
3248 * 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
3249 * @param buffer The memory buffer containing the uncompressed image.
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3250 * @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
3251 * quality, best compression) and 100 (best quality, worst
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3252 * compression).
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3253 * @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
3254 * @ingroup Images
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3255 **/
1598
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3256 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCompressJpegImage(
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3257 OrthancPluginContext* context,
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3258 OrthancPluginMemoryBuffer* target,
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3259 OrthancPluginPixelFormat format,
1598
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3260 uint32_t width,
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3261 uint32_t height,
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3262 uint32_t pitch,
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3263 const void* buffer,
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3264 uint8_t quality)
1598
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3265 {
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3266 _OrthancPluginCompressImage params;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3267 memset(&params, 0, sizeof(params));
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3268 params.target = target;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3269 params.imageFormat = OrthancPluginImageFormat_Jpeg;
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3270 params.pixelFormat = format;
1598
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3271 params.width = width;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3272 params.height = height;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3273 params.pitch = pitch;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3274 params.buffer = buffer;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3275 params.quality = quality;
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3276
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3277 return context->InvokeService(context, _OrthancPluginService_CompressImage, &params);
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3278 }
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3279
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3280
c6b50b803387 primitives for image encoding/decoding in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
3281
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3282 /**
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3283 * @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
3284 *
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3285 * 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
3286 * parameters of this function describe a memory buffer that
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3287 * 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
3288 * 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
3289 *
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3290 * @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
3291 * @param output The HTTP connection to the client application.
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3292 * @param format The memory layout of the uncompressed image.
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3293 * @param width The width of the image.
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3294 * @param height The height of the image.
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3295 * @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
3296 * 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
3297 * @param buffer The memory buffer containing the uncompressed image.
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3298 * @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
3299 * quality, best compression) and 100 (best quality, worst
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3300 * compression).
1601
6cccf1da35c6 groups in the plugin documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1600
diff changeset
3301 * @ingroup REST
1600
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3302 **/
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3303 ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerJpegImage(
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3304 OrthancPluginContext* context,
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3305 OrthancPluginRestOutput* output,
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3306 OrthancPluginPixelFormat format,
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3307 uint32_t width,
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3308 uint32_t height,
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3309 uint32_t pitch,
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3310 const void* buffer,
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3311 uint8_t quality)
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3312 {
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3313 _OrthancPluginCompressAndAnswerImage params;
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3314 params.output = output;
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3315 params.imageFormat = OrthancPluginImageFormat_Jpeg;
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3316 params.pixelFormat = format;
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3317 params.width = width;
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3318 params.height = height;
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3319 params.pitch = pitch;
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3320 params.buffer = buffer;
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3321 params.quality = quality;
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3322 context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, &params);
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3323 }
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3324
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3325
7151d63e6d81 documentation, primitives for jpeg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1599
diff changeset
3326
1606
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3327
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3328 typedef struct
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 OrthancPluginMemoryBuffer* target;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3331 OrthancPluginHttpMethod method;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3332 const char* url;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3333 const char* username;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3334 const char* password;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3335 const char* body;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3336 uint32_t bodySize;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3337 } _OrthancPluginCallHttpClient;
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
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3340 /**
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3341 * @brief Issue a HTTP GET call.
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3342 *
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3343 * 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
3344 * 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
3345 * 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
3346 * Orthanc instance that hosts this plugin.
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3347 *
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3348 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1821
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
3349 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
1606
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3350 * @param url The URL of interest.
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3351 * @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
3352 * @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
3353 * @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
3354 **/
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3355 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpGet(
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3356 OrthancPluginContext* context,
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3357 OrthancPluginMemoryBuffer* target,
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3358 const char* url,
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3359 const char* username,
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3360 const char* password)
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3361 {
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3362 _OrthancPluginCallHttpClient params;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3363 memset(&params, 0, sizeof(params));
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3364
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3365 params.target = target;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3366 params.method = OrthancPluginHttpMethod_Get;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3367 params.url = url;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3368 params.username = username;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3369 params.password = password;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3370
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3371 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
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
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3374
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 * @brief Issue a HTTP POST call.
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3377 *
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3378 * 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
3379 * 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
3380 * 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
3381 * 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
3382 *
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3383 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1821
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
3384 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
1606
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3385 * @param url The URL of interest.
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3386 * @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
3387 * @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
3388 * @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
3389 * @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
3390 * @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
3391 **/
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3392 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpPost(
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3393 OrthancPluginContext* context,
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3394 OrthancPluginMemoryBuffer* target,
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3395 const char* url,
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3396 const char* body,
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3397 uint32_t bodySize,
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3398 const char* username,
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3399 const char* password)
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3400 {
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3401 _OrthancPluginCallHttpClient params;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3402 memset(&params, 0, sizeof(params));
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3403
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3404 params.target = target;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3405 params.method = OrthancPluginHttpMethod_Post;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3406 params.url = url;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3407 params.body = body;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3408 params.bodySize = bodySize;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3409 params.username = username;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3410 params.password = password;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3411
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3412 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3413 }
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3414
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3415
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3416 /**
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3417 * @brief Issue a HTTP PUT call.
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3418 *
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3419 * 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
3420 * 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
3421 * 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
3422 * Orthanc instance that hosts this plugin.
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3423 *
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3424 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1821
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
3425 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
1606
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3426 * @param url The URL of interest.
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3427 * @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
3428 * @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
3429 * @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
3430 * @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
3431 * @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
3432 **/
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3433 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpPut(
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3434 OrthancPluginContext* context,
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3435 OrthancPluginMemoryBuffer* target,
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3436 const char* url,
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3437 const char* body,
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3438 uint32_t bodySize,
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3439 const char* username,
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3440 const char* password)
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3441 {
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3442 _OrthancPluginCallHttpClient params;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3443 memset(&params, 0, sizeof(params));
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3444
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3445 params.target = target;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3446 params.method = OrthancPluginHttpMethod_Put;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3447 params.url = url;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3448 params.body = body;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3449 params.bodySize = bodySize;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3450 params.username = username;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3451 params.password = password;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3452
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3453 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3454 }
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3455
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3456
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3457 /**
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3458 * @brief Issue a HTTP DELETE call.
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3459 *
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3460 * 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
3461 * 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
3462 * 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
3463 *
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3464 * @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
3465 * @param url The URL of interest.
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3466 * @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
3467 * @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
3468 * @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
3469 **/
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3470 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpDelete(
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3471 OrthancPluginContext* context,
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3472 const char* url,
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3473 const char* username,
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3474 const char* password)
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3475 {
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3476 _OrthancPluginCallHttpClient params;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3477 memset(&params, 0, sizeof(params));
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3478
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3479 params.method = OrthancPluginHttpMethod_Delete;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3480 params.url = url;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3481 params.username = username;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3482 params.password = password;
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3483
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3484 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3485 }
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3486
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3487
31f4adefb88f issuing HTTP requests from the plugin SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1605
diff changeset
3488
1608
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3489 typedef struct
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3490 {
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3491 OrthancPluginImage** target;
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3492 const OrthancPluginImage* source;
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3493 OrthancPluginPixelFormat targetFormat;
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3494 } _OrthancPluginConvertPixelFormat;
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3495
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3496
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3497 /**
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3498 * @brief Change the pixel format of an image.
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3499 *
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3500 * 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
3501 *
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3502 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3503 * @param source The source image.
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3504 * @param targetFormat The target pixel format.
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3505 * @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
3506 * @ingroup Images
1608
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3507 **/
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3508 ORTHANC_PLUGIN_INLINE OrthancPluginImage *OrthancPluginConvertPixelFormat(
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3509 OrthancPluginContext* context,
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3510 const OrthancPluginImage* source,
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3511 OrthancPluginPixelFormat targetFormat)
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3512 {
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3513 OrthancPluginImage* target = NULL;
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3514
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3515 _OrthancPluginConvertPixelFormat params;
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3516 params.target = &target;
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3517 params.source = source;
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3518 params.targetFormat = targetFormat;
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3519
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3520 if (context->InvokeService(context, _OrthancPluginService_ConvertPixelFormat, &params) != OrthancPluginErrorCode_Success)
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3521 {
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3522 return NULL;
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3523 }
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3524 else
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3525 {
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3526 return target;
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3527 }
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3528 }
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3529
adc6a5704cdb OrthancPluginConvertPixelFormat
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1606
diff changeset
3530
1613
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 * @brief Return the number of available fonts.
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 * 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
3536 * 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
3537 * through OrthancPluginDrawText().
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3538 *
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3539 * @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
3540 * @return The number of fonts.
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3541 * @ingroup Images
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3542 **/
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3543 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontsCount(
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3544 OrthancPluginContext* context)
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3545 {
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3546 uint32_t count = 0;
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 _OrthancPluginReturnSingleValue params;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3549 memset(&params, 0, sizeof(params));
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3550 params.resultUint32 = &count;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3551
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3552 if (context->InvokeService(context, _OrthancPluginService_GetFontsCount, &params) != OrthancPluginErrorCode_Success)
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3553 {
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3554 /* Error */
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3555 return 0;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3556 }
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3557 else
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3558 {
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3559 return count;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3560 }
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3561 }
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3562
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3563
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3564
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3565
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3566 typedef struct
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3567 {
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3568 uint32_t fontIndex; /* in */
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3569 const char** name; /* out */
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3570 uint32_t* size; /* out */
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3571 } _OrthancPluginGetFontInfo;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3572
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3573 /**
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3574 * @brief Return the name of a font.
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3575 *
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3576 * This function returns the 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
3577 *
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3578 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3579 * @param fontIndex The index of the font. This value must be less than OrthancPluginGetFontsCount().
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3580 * @return The font 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
3581 * @ingroup Images
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3582 **/
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3583 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetFontName(
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3584 OrthancPluginContext* context,
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3585 uint32_t fontIndex)
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3586 {
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3587 const char* result = NULL;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3588
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3589 _OrthancPluginGetFontInfo params;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3590 memset(&params, 0, sizeof(params));
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3591 params.name = &result;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3592 params.fontIndex = fontIndex;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3593
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3594 if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, &params) != OrthancPluginErrorCode_Success)
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3595 {
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3596 return NULL;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3597 }
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3598 else
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3599 {
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3600 return result;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3601 }
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3602 }
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3603
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3604
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3605 /**
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3606 * @brief Return the size of a font.
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3607 *
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3608 * 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
3609 *
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3610 * @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
3611 * @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
3612 * @return The font size.
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3613 * @ingroup Images
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3614 **/
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3615 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontSize(
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3616 OrthancPluginContext* context,
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3617 uint32_t fontIndex)
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3618 {
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3619 uint32_t result;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3620
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3621 _OrthancPluginGetFontInfo params;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3622 memset(&params, 0, sizeof(params));
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3623 params.size = &result;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3624 params.fontIndex = fontIndex;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3625
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3626 if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, &params) != OrthancPluginErrorCode_Success)
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3627 {
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3628 return 0;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3629 }
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3630 else
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3631 {
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3632 return result;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3633 }
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3634 }
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3635
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3636
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3637
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3638 typedef struct
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3639 {
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3640 OrthancPluginImage* image;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3641 uint32_t fontIndex;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3642 const char* utf8Text;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3643 int32_t x;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3644 int32_t y;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3645 uint8_t r;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3646 uint8_t g;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3647 uint8_t b;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3648 } _OrthancPluginDrawText;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3649
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3650
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3651 /**
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3652 * @brief Draw text on an image.
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3653 *
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3654 * 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
3655 *
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3656 * @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
3657 * @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
3658 * @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
3659 * @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
3660 * @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
3661 * @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
3662 * @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
3663 * @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
3664 * @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
3665 * @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
3666 * @ingroup Images
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3667 **/
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3668 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginDrawText(
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3669 OrthancPluginContext* context,
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3670 OrthancPluginImage* image,
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3671 uint32_t fontIndex,
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3672 const char* utf8Text,
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3673 int32_t x,
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3674 int32_t y,
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3675 uint8_t r,
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3676 uint8_t g,
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3677 uint8_t b)
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3678 {
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3679 _OrthancPluginDrawText params;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3680 memset(&params, 0, sizeof(params));
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3681 params.image = image;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3682 params.fontIndex = fontIndex;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3683 params.utf8Text = utf8Text;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3684 params.x = x;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3685 params.y = y;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3686 params.r = r;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3687 params.g = g;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3688 params.b = b;
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3689
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3690 return context->InvokeService(context, _OrthancPluginService_DrawText, &params);
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3691 }
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3692
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3693
1ec254a7c645 drawing texts on image from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1610
diff changeset
3694
1615
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3695 typedef struct
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3696 {
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3697 OrthancPluginStorageArea* storageArea;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3698 const char* uuid;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3699 const void* content;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3700 uint64_t size;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3701 OrthancPluginContentType type;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3702 } _OrthancPluginStorageAreaCreate;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3703
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3704
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3705 /**
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3706 * @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
3707 *
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3708 * 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
3709 * currently used by Orthanc.
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 * @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
3712 * @param storageArea The storage area.
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3713 * @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
3714 * @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
3715 * @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
3716 * @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
3717 * @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
3718 * @ingroup Callbacks
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3719 **/
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3720 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaCreate(
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3721 OrthancPluginContext* context,
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3722 OrthancPluginStorageArea* storageArea,
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3723 const char* uuid,
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3724 const void* content,
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3725 uint64_t size,
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3726 OrthancPluginContentType type)
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3727 {
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3728 _OrthancPluginStorageAreaCreate params;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3729 params.storageArea = storageArea;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3730 params.uuid = uuid;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3731 params.content = content;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3732 params.size = size;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3733 params.type = type;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3734
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3735 return context->InvokeService(context, _OrthancPluginService_StorageAreaCreate, &params);
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3736 }
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3737
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3738
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3739 typedef struct
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3740 {
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3741 OrthancPluginMemoryBuffer* target;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3742 OrthancPluginStorageArea* storageArea;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3743 const char* uuid;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3744 OrthancPluginContentType type;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3745 } _OrthancPluginStorageAreaRead;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3746
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3747
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3748 /**
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3749 * @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
3750 *
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3751 * 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
3752 * 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
3753 *
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3754 * @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
3755 * @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
3756 * @param storageArea The storage area.
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3757 * @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
3758 * @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
3759 * @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
3760 * @ingroup Callbacks
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3761 **/
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3762 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaRead(
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3763 OrthancPluginContext* context,
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3764 OrthancPluginMemoryBuffer* target,
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3765 OrthancPluginStorageArea* storageArea,
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3766 const char* uuid,
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3767 OrthancPluginContentType type)
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3768 {
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3769 _OrthancPluginStorageAreaRead params;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3770 params.target = target;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3771 params.storageArea = storageArea;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3772 params.uuid = uuid;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3773 params.type = type;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3774
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3775 return context->InvokeService(context, _OrthancPluginService_StorageAreaRead, &params);
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3776 }
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3777
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3778
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3779 typedef struct
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3780 {
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3781 OrthancPluginStorageArea* storageArea;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3782 const char* uuid;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3783 OrthancPluginContentType type;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3784 } _OrthancPluginStorageAreaRemove;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3785
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3786 /**
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3787 * @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
3788 *
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3789 * 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
3790 * currently used by Orthanc.
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3791 *
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3792 * @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
3793 * @param storageArea The storage area.
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3794 * @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
3795 * @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
3796 * @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
3797 * @ingroup Callbacks
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3798 **/
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3799 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaRemove(
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3800 OrthancPluginContext* context,
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3801 OrthancPluginStorageArea* storageArea,
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3802 const char* uuid,
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3803 OrthancPluginContentType type)
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3804 {
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3805 _OrthancPluginStorageAreaRemove params;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3806 params.storageArea = storageArea;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3807 params.uuid = uuid;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3808 params.type = type;
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3809
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3810 return context->InvokeService(context, _OrthancPluginService_StorageAreaRemove, &params);
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3811 }
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3812
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3813
c40fe92a68e7 Primitives to upgrade the database version in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1613
diff changeset
3814
1649
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3815 typedef struct
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3816 {
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3817 OrthancPluginErrorCode* target;
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3818 int32_t code;
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3819 uint16_t httpStatus;
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3820 const char* message;
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3821 } _OrthancPluginRegisterErrorCode;
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3822
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3823 /**
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3824 * @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
3825 *
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3826 * 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
3827 * 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
3828 * 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
3829 * HTTP status code.
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3830 *
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3831 * @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
3832 * @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
3833 * @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
3834 * @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
3835 * @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
3836 * @ingroup Toolbox
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3837 **/
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3838 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterErrorCode(
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3839 OrthancPluginContext* context,
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3840 int32_t code,
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3841 uint16_t httpStatus,
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3842 const char* message)
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3843 {
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3844 OrthancPluginErrorCode target;
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3845
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3846 _OrthancPluginRegisterErrorCode params;
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3847 params.target = &target;
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3848 params.code = code;
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3849 params.httpStatus = httpStatus;
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3850 params.message = message;
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3851
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3852 if (context->InvokeService(context, _OrthancPluginService_RegisterErrorCode, &params) == OrthancPluginErrorCode_Success)
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3853 {
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3854 return target;
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3855 }
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3856 else
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3857 {
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3858 /* 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
3859 return OrthancPluginErrorCode_Plugin;
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3860 }
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3861 }
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3862
8040d56cb0b3 New function "OrthancPluginRegisterErrorCode()" to declare custom error codes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1643
diff changeset
3863
1657
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3864
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3865 typedef struct
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3866 {
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3867 uint16_t group;
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3868 uint16_t element;
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3869 OrthancPluginValueRepresentation vr;
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3870 const char* name;
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3871 uint32_t minMultiplicity;
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3872 uint32_t maxMultiplicity;
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3873 } _OrthancPluginRegisterDictionaryTag;
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3874
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3875 /**
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3876 * @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
3877 *
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3878 * This function declares a new tag in the dictionary of DICOM tags
1765
57b9e6890482 New configuration option: "Dictionary" to declare custom DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1760
diff changeset
3879 * that are known to Orthanc. This function should be used in the
1657
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3880 * OrthancPluginInitialize() callback.
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3881 *
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3882 * @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
3883 * @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
3884 * @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
3885 * @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
3886 * @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
3887 * @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
3888 * @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
3889 * an arbitrary multiplicity ("<tt>n</tt>").
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3890 * @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
3891 * @ingroup Toolbox
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3892 **/
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3893 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterDictionaryTag(
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3894 OrthancPluginContext* context,
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3895 uint16_t group,
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3896 uint16_t element,
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3897 OrthancPluginValueRepresentation vr,
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3898 const char* name,
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3899 uint32_t minMultiplicity,
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3900 uint32_t maxMultiplicity)
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3901 {
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3902 _OrthancPluginRegisterDictionaryTag params;
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3903 params.group = group;
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3904 params.element = element;
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3905 params.vr = vr;
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3906 params.name = name;
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3907 params.minMultiplicity = minMultiplicity;
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3908 params.maxMultiplicity = maxMultiplicity;
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3909
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3910 return context->InvokeService(context, _OrthancPluginService_RegisterDictionaryTag, &params);
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3911 }
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3912
5360cdba70d8 New function "OrthancPluginRegisterDictionaryTag()" to declare DICOM tags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1649
diff changeset
3913
1669
a412ad57f0f9 refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1657
diff changeset
3914
a412ad57f0f9 refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1657
diff changeset
3915
a412ad57f0f9 refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1657
diff changeset
3916 typedef struct
a412ad57f0f9 refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1657
diff changeset
3917 {
a412ad57f0f9 refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1657
diff changeset
3918 OrthancPluginStorageArea* storageArea;
a412ad57f0f9 refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1657
diff changeset
3919 OrthancPluginResourceType level;
a412ad57f0f9 refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1657
diff changeset
3920 } _OrthancPluginReconstructMainDicomTags;
a412ad57f0f9 refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1657
diff changeset
3921
1673
0bbcfd9695e5 UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1669
diff changeset
3922 /**
0bbcfd9695e5 UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1669
diff changeset
3923 * @brief Reconstruct the main DICOM tags.
0bbcfd9695e5 UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1669
diff changeset
3924 *
0bbcfd9695e5 UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1669
diff changeset
3925 * 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
3926 * 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
3927 * 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
3928 * back-end
0bbcfd9695e5 UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1669
diff changeset
3929 * (cf. OrthancPlugins::IDatabaseBackend::UpgradeDatabase). A
0bbcfd9695e5 UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1669
diff changeset
3930 * database transaction will be automatically setup.
0bbcfd9695e5 UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1669
diff changeset
3931 *
0bbcfd9695e5 UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1669
diff changeset
3932 * @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
3933 * @param storageArea The storage area.
0bbcfd9695e5 UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1669
diff changeset
3934 * @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
3935 * @return 0 if success, other value if error.
0bbcfd9695e5 UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1669
diff changeset
3936 * @ingroup Callbacks
0bbcfd9695e5 UpgradeDatabase in the sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1669
diff changeset
3937 **/
1669
a412ad57f0f9 refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1657
diff changeset
3938 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginReconstructMainDicomTags(
a412ad57f0f9 refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1657
diff changeset
3939 OrthancPluginContext* context,
a412ad57f0f9 refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1657
diff changeset
3940 OrthancPluginStorageArea* storageArea,
a412ad57f0f9 refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1657
diff changeset
3941 OrthancPluginResourceType level)
a412ad57f0f9 refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1657
diff changeset
3942 {
a412ad57f0f9 refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1657
diff changeset
3943 _OrthancPluginReconstructMainDicomTags params;
a412ad57f0f9 refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1657
diff changeset
3944 params.level = level;
a412ad57f0f9 refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1657
diff changeset
3945 params.storageArea = storageArea;
a412ad57f0f9 refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1657
diff changeset
3946
a412ad57f0f9 refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1657
diff changeset
3947 return context->InvokeService(context, _OrthancPluginService_ReconstructMainDicomTags, &params);
a412ad57f0f9 refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1657
diff changeset
3948 }
a412ad57f0f9 refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1657
diff changeset
3949
a412ad57f0f9 refactoring of sample plugins, OrthancPluginReconstructMainDicomTags
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1657
diff changeset
3950
1740
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
3951 typedef struct
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
3952 {
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
3953 char** result;
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
3954 const char* instanceId;
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
3955 const char* buffer;
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
3956 uint32_t size;
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
3957 OrthancPluginDicomToJsonFormat format;
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
3958 OrthancPluginDicomToJsonFlags flags;
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
3959 uint32_t maxStringLength;
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
3960 } _OrthancPluginDicomToJson;
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
3961
1743
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
3962
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
3963 /**
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
3964 * @brief Format a DICOM memory buffer as a JSON string.
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
3965 *
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
3966 * This function takes as input a memory buffer containing a DICOM
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
3967 * file, and outputs a JSON string representing the tags of this
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
3968 * DICOM file.
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
3969 *
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
3970 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
3971 * @param buffer The memory buffer containing the DICOM file.
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
3972 * @param size The size of the memory buffer.
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
3973 * @param format The output format.
1821
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
3974 * @param flags Flags governing the output.
1743
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
3975 * @param maxStringLength The maximum length of a field. Too long fields will
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
3976 * be output as "null". The 0 value means no maximum length.
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
3977 * @return The NULL value if the case of an error, or the JSON
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
3978 * string. This string must be freed by OrthancPluginFreeString().
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
3979 * @ingroup Toolbox
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
3980 * @see OrthancPluginDicomInstanceToJson
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
3981 **/
1740
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
3982 ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomBufferToJson(
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
3983 OrthancPluginContext* context,
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
3984 const char* buffer,
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
3985 uint32_t size,
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
3986 OrthancPluginDicomToJsonFormat format,
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
3987 OrthancPluginDicomToJsonFlags flags,
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
3988 uint32_t maxStringLength)
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
3989 {
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
3990 char* result;
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
3991
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
3992 _OrthancPluginDicomToJson params;
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
3993 memset(&params, 0, sizeof(params));
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
3994 params.result = &result;
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
3995 params.buffer = buffer;
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
3996 params.size = size;
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
3997 params.format = format;
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
3998 params.flags = flags;
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
3999 params.maxStringLength = maxStringLength;
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4000
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4001 if (context->InvokeService(context, _OrthancPluginService_DicomBufferToJson, &params) != OrthancPluginErrorCode_Success)
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4002 {
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4003 /* Error */
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4004 return NULL;
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4005 }
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4006 else
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4007 {
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4008 return result;
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4009 }
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4010 }
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4011
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4012
1743
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
4013 /**
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
4014 * @brief Format a DICOM instance as a JSON string.
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
4015 *
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
4016 * This function formats a DICOM instance that is stored in Orthanc,
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
4017 * and outputs a JSON string representing the tags of this DICOM
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
4018 * instance.
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
4019 *
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
4020 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
4021 * @param instanceId The Orthanc identifier of the instance.
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
4022 * @param format The output format.
1821
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4023 * @param flags Flags governing the output.
1743
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
4024 * @param maxStringLength The maximum length of a field. Too long fields will
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
4025 * be output as "null". The 0 value means no maximum length.
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
4026 * @return The NULL value if the case of an error, or the JSON
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
4027 * string. This string must be freed by OrthancPluginFreeString().
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
4028 * @ingroup Toolbox
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
4029 * @see OrthancPluginDicomInstanceToJson
8fc1d096aa38 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1741
diff changeset
4030 **/
1740
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4031 ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomInstanceToJson(
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4032 OrthancPluginContext* context,
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4033 const char* instanceId,
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4034 OrthancPluginDicomToJsonFormat format,
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4035 OrthancPluginDicomToJsonFlags flags,
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4036 uint32_t maxStringLength)
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4037 {
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4038 char* result;
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4039
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4040 _OrthancPluginDicomToJson params;
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4041 memset(&params, 0, sizeof(params));
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4042 params.result = &result;
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4043 params.instanceId = instanceId;
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4044 params.format = format;
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4045 params.flags = flags;
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4046 params.maxStringLength = maxStringLength;
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4047
1741
06addfcd1d4c OrthancStarted and OrthancStopped events in plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1740
diff changeset
4048 if (context->InvokeService(context, _OrthancPluginService_DicomInstanceToJson, &params) != OrthancPluginErrorCode_Success)
1740
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4049 {
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4050 /* Error */
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4051 return NULL;
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4052 }
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4053 else
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4054 {
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4055 return result;
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4056 }
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4057 }
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4058
5e99a70b0635 DicomToJson callable from plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1703
diff changeset
4059
1780
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4060 typedef struct
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4061 {
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4062 OrthancPluginMemoryBuffer* target;
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4063 const char* uri;
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4064 uint32_t headersCount;
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4065 const char* const* headersKeys;
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4066 const char* const* headersValues;
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4067 int32_t afterPlugins;
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4068 } _OrthancPluginRestApiGet2;
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4069
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4070 /**
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4071 * @brief Make a GET call to the Orthanc REST API, with custom HTTP headers.
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4072 *
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4073 * Make a GET call to the Orthanc REST API with extended
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4074 * parameters. The result to the query is stored into a newly
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4075 * allocated memory buffer.
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4076 *
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4077 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1821
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4078 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
1780
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4079 * @param uri The URI in the built-in Orthanc API.
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4080 * @param headersCount The number of HTTP headers.
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4081 * @param headersKeys Array containing the keys of the HTTP headers.
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4082 * @param headersValues Array containing the values of the HTTP headers.
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4083 * @param afterPlugins If 0, the built-in API of Orthanc is used.
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4084 * If 1, the API is tainted by the plugins.
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4085 * @return 0 if success, or the error code if failure.
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4086 * @see OrthancPluginRestApiGet, OrthancPluginRestApiGetAfterPlugins
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4087 * @ingroup Orthanc
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4088 **/
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4089 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGet2(
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4090 OrthancPluginContext* context,
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4091 OrthancPluginMemoryBuffer* target,
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4092 const char* uri,
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4093 uint32_t headersCount,
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4094 const char* const* headersKeys,
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4095 const char* const* headersValues,
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4096 int32_t afterPlugins)
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4097 {
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4098 _OrthancPluginRestApiGet2 params;
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4099 params.target = target;
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4100 params.uri = uri;
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4101 params.headersCount = headersCount;
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4102 params.headersKeys = headersKeys;
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4103 params.headersValues = headersValues;
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4104 params.afterPlugins = afterPlugins;
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4105
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4106 return context->InvokeService(context, _OrthancPluginService_RestApiGet2, &params);
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4107 }
94990da8710e OrthancPluginRestApiGet2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1773
diff changeset
4108
1800
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4109
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4110
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4111 typedef struct
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4112 {
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4113 OrthancPluginWorklistCallback callback;
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4114 } _OrthancPluginWorklistCallback;
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4115
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4116 /**
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4117 * @brief Register a callback to handle modality worklists requests.
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4118 *
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4119 * This function registers a callback to handle C-Find SCP requests
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4120 * on modality worklists.
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4121 *
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4122 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4123 * @param callback The callback.
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4124 * @ingroup Worklists
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4125 **/
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4126 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterWorklistCallback(
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4127 OrthancPluginContext* context,
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4128 OrthancPluginWorklistCallback callback)
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4129 {
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4130 _OrthancPluginWorklistCallback params;
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4131 params.callback = callback;
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4132
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4133 context->InvokeService(context, _OrthancPluginService_RegisterWorklistCallback, &params);
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4134 }
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4135
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4136
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4137
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4138 typedef struct
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4139 {
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1801
diff changeset
4140 OrthancPluginWorklistAnswers* answers;
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1801
diff changeset
4141 const OrthancPluginWorklistQuery* query;
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1801
diff changeset
4142 const void* dicom;
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1801
diff changeset
4143 uint32_t size;
1801
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4144 } _OrthancPluginWorklistAnswersOperation;
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4145
1803
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4146 /**
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4147 * @brief Add one answer to some modality worklist request.
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4148 *
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4149 * This function adds one worklist (encoded as a DICOM file) to the
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4150 * set of answers corresponding to some C-Find SCP request against
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4151 * modality worklists.
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4152 *
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4153 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4154 * @param answers The set of answers.
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4155 * @param query The worklist query, as received by the callback.
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4156 * @param dicom The worklist to answer, encoded as a DICOM file.
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4157 * @param size The size of the DICOM file.
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4158 * @return 0 if success, other value if error.
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4159 * @ingroup Worklists
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4160 **/
1810
796d0b087fb8 more consistent naming in worklist primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1803
diff changeset
4161 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistAddAnswer(
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1801
diff changeset
4162 OrthancPluginContext* context,
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1801
diff changeset
4163 OrthancPluginWorklistAnswers* answers,
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1801
diff changeset
4164 const OrthancPluginWorklistQuery* query,
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1801
diff changeset
4165 const void* dicom,
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1801
diff changeset
4166 uint32_t size)
1800
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4167 {
1801
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4168 _OrthancPluginWorklistAnswersOperation params;
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4169 params.answers = answers;
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1801
diff changeset
4170 params.query = query;
1801
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4171 params.dicom = dicom;
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4172 params.size = size;
1800
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4173
1810
796d0b087fb8 more consistent naming in worklist primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1803
diff changeset
4174 return context->InvokeService(context, _OrthancPluginService_WorklistAddAnswer, &params);
1800
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4175 }
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4176
30e97a1f4093 callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1799
diff changeset
4177
1803
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4178 /**
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4179 * @brief Mark the set of worklist answers as incomplete.
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4180 *
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4181 * This function marks as incomplete the set of answers
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4182 * corresponding to some C-Find SCP request against modality
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4183 * worklists. This must be used if canceling the handling of a
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4184 * request when too many answers are to be returned.
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4185 *
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4186 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4187 * @param answers The set of answers.
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4188 * @return 0 if success, other value if error.
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4189 * @ingroup Worklists
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4190 **/
1810
796d0b087fb8 more consistent naming in worklist primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1803
diff changeset
4191 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistMarkIncomplete(
1801
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4192 OrthancPluginContext* context,
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4193 OrthancPluginWorklistAnswers* answers)
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4194 {
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4195 _OrthancPluginWorklistAnswersOperation params;
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4196 params.answers = answers;
1802
138664eb59de sample worklist plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1801
diff changeset
4197 params.query = NULL;
1801
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4198 params.dicom = NULL;
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4199 params.size = 0;
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4200
1810
796d0b087fb8 more consistent naming in worklist primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1803
diff changeset
4201 return context->InvokeService(context, _OrthancPluginService_WorklistMarkIncomplete, &params);
1801
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4202 }
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4203
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4204
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4205 typedef struct
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4206 {
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4207 const OrthancPluginWorklistQuery* query;
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4208 const void* dicom;
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4209 uint32_t size;
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4210 int32_t* isMatch;
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4211 OrthancPluginMemoryBuffer* target;
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4212 } _OrthancPluginWorklistQueryOperation;
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4213
1803
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4214 /**
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4215 * @brief Test whether a worklist matches the query.
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4216 *
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4217 * This function checks whether one worklist (encoded as a DICOM
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4218 * file) matches the C-Find SCP query against modality
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4219 * worklists. This function must be called before adding the
1810
796d0b087fb8 more consistent naming in worklist primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1803
diff changeset
4220 * worklist as an answer through OrthancPluginWorklistAddAnswer().
1803
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4221 *
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4222 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4223 * @param query The worklist query, as received by the callback.
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4224 * @param dicom The worklist to answer, encoded as a DICOM file.
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4225 * @param size The size of the DICOM file.
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4226 * @return 1 if the worklist matches the query, 0 otherwise.
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4227 * @ingroup Worklists
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4228 **/
1810
796d0b087fb8 more consistent naming in worklist primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1803
diff changeset
4229 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginWorklistIsMatch(
1801
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4230 OrthancPluginContext* context,
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4231 const OrthancPluginWorklistQuery* query,
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4232 const void* dicom,
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4233 uint32_t size)
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4234 {
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4235 int32_t isMatch = 0;
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4236
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4237 _OrthancPluginWorklistQueryOperation params;
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4238 params.query = query;
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4239 params.dicom = dicom;
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4240 params.size = size;
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4241 params.isMatch = &isMatch;
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4242 params.target = NULL;
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4243
1810
796d0b087fb8 more consistent naming in worklist primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1803
diff changeset
4244 if (context->InvokeService(context, _OrthancPluginService_WorklistIsMatch, &params) == OrthancPluginErrorCode_Success)
1801
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4245 {
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4246 return isMatch;
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4247 }
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4248 else
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4249 {
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4250 /* Error: Assume non-match */
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4251 return 0;
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4252 }
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4253 }
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4254
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4255
1803
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4256 /**
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4257 * @brief Retrieve the worklist query as a DICOM file.
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4258 *
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4259 * This function retrieves the DICOM file that underlies a C-Find
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4260 * SCP query against modality worklists.
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4261 *
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4262 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4263 * @param target Memory buffer where to store the DICOM file. It must be freed with OrthancPluginFreeMemoryBuffer().
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4264 * @param query The worklist query, as received by the callback.
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4265 * @return 0 if success, other value if error.
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4266 * @ingroup Worklists
d093f998a83b documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1802
diff changeset
4267 **/
1810
796d0b087fb8 more consistent naming in worklist primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1803
diff changeset
4268 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistGetDicomQuery(
1801
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4269 OrthancPluginContext* context,
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4270 OrthancPluginMemoryBuffer* target,
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4271 const OrthancPluginWorklistQuery* query)
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4272 {
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4273 _OrthancPluginWorklistQueryOperation params;
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4274 params.query = query;
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4275 params.dicom = NULL;
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4276 params.size = 0;
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4277 params.isMatch = NULL;
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4278 params.target = target;
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4279
1810
796d0b087fb8 more consistent naming in worklist primitives
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1803
diff changeset
4280 return context->InvokeService(context, _OrthancPluginService_WorklistGetDicomQuery, &params);
1801
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4281 }
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4282
2c60c357ee3e sdk primitives to handle worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1800
diff changeset
4283
1815
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4284 /**
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4285 * @brief Get the origin of a DICOM file.
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4286 *
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4287 * This function returns the origin of a DICOM instance that has been received by Orthanc.
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4288 *
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4289 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4290 * @param instance The instance of interest.
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4291 * @return The origin of the instance.
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4292 * @ingroup Callbacks
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4293 **/
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4294 ORTHANC_PLUGIN_INLINE OrthancPluginInstanceOrigin OrthancPluginGetInstanceOrigin(
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4295 OrthancPluginContext* context,
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4296 OrthancPluginDicomInstance* instance)
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4297 {
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4298 OrthancPluginInstanceOrigin origin;
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4299
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4300 _OrthancPluginAccessDicomInstance params;
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4301 memset(&params, 0, sizeof(params));
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4302 params.resultOrigin = &origin;
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4303 params.instance = instance;
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4304
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4305 if (context->InvokeService(context, _OrthancPluginService_GetInstanceOrigin, &params) != OrthancPluginErrorCode_Success)
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4306 {
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4307 /* Error */
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4308 return OrthancPluginInstanceOrigin_Unknown;
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4309 }
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4310 else
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4311 {
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4312 return origin;
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4313 }
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4314 }
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4315
2abfdca9b915 OrthancPluginGetInstanceOrigin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1810
diff changeset
4316
1821
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4317 typedef struct
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4318 {
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4319 OrthancPluginMemoryBuffer* target;
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4320 const char* json;
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4321 OrthancPluginDicomFromJsonFlags flags;
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4322 } _OrthancPluginDicomFromJson;
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4323
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4324 /**
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4325 * @brief Create a DICOM instance from JSON.
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4326 *
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4327 * This function takes as input a string containing a JSON file
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4328 * describing the content of a DICOM instance. As an output, it
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4329 * writes the corresponding DICOM instance to a newly allocated
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4330 * memory buffer.
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4331 *
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4332 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4333 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4334 * @param json The input JSON file.
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4335 * @param flags Flags governing the output.
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4336 * @return 0 if success, other value if error.
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4337 * @ingroup Toolbox
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4338 * @see OrthancPluginDicomBufferToJson
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4339 **/
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4340 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginDicomFromJson(
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4341 OrthancPluginContext* context,
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4342 OrthancPluginMemoryBuffer* target,
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4343 const char* json,
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4344 OrthancPluginDicomFromJsonFlags flags)
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4345 {
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4346 _OrthancPluginDicomFromJson params;
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4347 params.target = target;
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4348 params.json = json;
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4349 params.flags = flags;
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4350
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4351 return context->InvokeService(context, _OrthancPluginService_DicomFromJson, &params);
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4352 }
580951a33583 OrthancPluginDicomFromJson
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1816
diff changeset
4353
886
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4354 #ifdef __cplusplus
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4355 }
29087d728e0a plugin sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4356 #endif
900
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
4357
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
4358
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
4359 /** @} */
1b92ce45cc8d plugin doc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 899
diff changeset
4360