annotate Resources/Orthanc/Sdk-1.4.0/orthanc/OrthancCPlugin.h @ 277:a3c4dce95a27

back to mainline
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 22 Apr 2021 16:10:34 +0200
parents c0cb5d2cd696
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
28
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * \mainpage
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * This C/C++ SDK allows external developers to create plugins that
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 * can be loaded into Orthanc to extend its functionality. Each
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 * Orthanc plugin must expose 4 public functions with the following
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * signatures:
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * -# <tt>int32_t OrthancPluginInitialize(const OrthancPluginContext* context)</tt>:
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * This function is invoked by Orthanc when it loads the plugin on startup.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * The plugin must:
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * - Check its compatibility with the Orthanc version using
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * ::OrthancPluginCheckVersion().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * - Store the context pointer so that it can use the plugin
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * services of Orthanc.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * - Register all its REST callbacks using ::OrthancPluginRegisterRestCallback().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * - Possibly register its callback for received DICOM instances using ::OrthancPluginRegisterOnStoredInstanceCallback().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * - Possibly register its callback for changes to the DICOM store using ::OrthancPluginRegisterOnChangeCallback().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * - Possibly register a custom storage area using ::OrthancPluginRegisterStorageArea().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * - Possibly register a custom database back-end area using OrthancPluginRegisterDatabaseBackendV2().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 * - Possibly register a handler for C-Find SCP using OrthancPluginRegisterFindCallback().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 * - Possibly register a handler for C-Find SCP against DICOM worklists using OrthancPluginRegisterWorklistCallback().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 * - Possibly register a handler for C-Move SCP using OrthancPluginRegisterMoveCallback().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 * - Possibly register a custom decoder for DICOM images using OrthancPluginRegisterDecodeImageCallback().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 * - Possibly register a callback to filter incoming HTTP requests using OrthancPluginRegisterIncomingHttpRequestFilter2().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 * -# <tt>void OrthancPluginFinalize()</tt>:
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 * This function is invoked by Orthanc during its shutdown. The plugin
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 * must free all its memory.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 * -# <tt>const char* OrthancPluginGetName()</tt>:
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 * The plugin must return a short string to identify itself.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 * -# <tt>const char* OrthancPluginGetVersion()</tt>:
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 * The plugin must return a string containing its version number.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 * The name and the version of a plugin is only used to prevent it
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 * from being loaded twice. Note that, in C++, it is mandatory to
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 * declare these functions within an <tt>extern "C"</tt> section.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 * To ensure multi-threading safety, the various REST callbacks are
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 * guaranteed to be executed in mutual exclusion since Orthanc
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 * 0.8.5. If this feature is undesired (notably when developing
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 * high-performance plugins handling simultaneous requests), use
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 * ::OrthancPluginRegisterRestCallbackNoLock().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 * @defgroup Images Images and compression
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 * @brief Functions to deal with images and compressed buffers.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 * @defgroup REST REST
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 * @brief Functions to answer REST requests in a callback.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 * @defgroup Callbacks Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 * @brief Functions to register and manage callbacks by the plugins.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 * @defgroup DicomCallbacks DicomCallbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 * @brief Functions to register and manage DICOM callbacks (worklists, C-Find, C-MOVE).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 * @defgroup Orthanc Orthanc
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 * @brief Functions to access the content of the Orthanc server.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 * @defgroup Toolbox Toolbox
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 * @brief Generic functions to help with the creation of plugins.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 * Orthanc - A Lightweight, RESTful DICOM Store
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 * Department, University Hospital of Liege, Belgium
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 * Copyright (C) 2017-2018 Osimis S.A., Belgium
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 * This program is free software: you can redistribute it and/or
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 * modify it under the terms of the GNU General Public License as
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 * published by the Free Software Foundation, either version 3 of the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 * License, or (at your option) any later version.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 * In addition, as a special exception, the copyright holders of this
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 * program give permission to link the code of its release with the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 * OpenSSL project's "OpenSSL" library (or with modified versions of it
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 * that use the same license as the "OpenSSL" library), and distribute
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 * the linked executables. You must obey the GNU General Public License
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 * in all respects for all of the code used other than "OpenSSL". If you
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 * modify file(s) with this exception, you may extend this exception to
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 * your version of the file(s), but you are not obligated to do so. If
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 * you do not wish to do so, delete this exception statement from your
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 * version. If you delete this exception statement from all source files
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 * in the program, then also delete it here.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 * This program is distributed in the hope that it will be useful, but
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 * WITHOUT ANY WARRANTY; without even the implied warranty of
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 * General Public License for more details.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 * You should have received a copy of the GNU General Public License
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 * along with this program. If not, see <http://www.gnu.org/licenses/>.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 #pragma once
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 #include <stdio.h>
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 #include <string.h>
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 #ifdef WIN32
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 #define ORTHANC_PLUGINS_API __declspec(dllexport)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 #else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 #define ORTHANC_PLUGINS_API
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 #endif
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 #define ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER 1
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120 #define ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER 4
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 #define ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER 0
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 #if !defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 #define ORTHANC_PLUGINS_VERSION_IS_ABOVE(major, minor, revision) \
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER > major || \
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER == major && \
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 (ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER > minor || \
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 (ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER == minor && \
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER >= revision))))
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 #endif
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 /********************************************************************
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 ** Check that function inlining is properly supported. The use of
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 ** inlining is required, to avoid the duplication of object code
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 ** between two compilation modules that would use the Orthanc Plugin
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 ** API.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 ********************************************************************/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 /* If the auto-detection of the "inline" keyword below does not work
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 automatically and that your compiler is known to properly support
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 inlining, uncomment the following #define and adapt the definition
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 of "static inline". */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 /* #define ORTHANC_PLUGIN_INLINE static inline */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 #ifndef ORTHANC_PLUGIN_INLINE
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 # if __STDC_VERSION__ >= 199901L
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 /* This is C99 or above: http://predef.sourceforge.net/prestd.html */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 # define ORTHANC_PLUGIN_INLINE static inline
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 # elif defined(__cplusplus)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154 /* This is C++ */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 # define ORTHANC_PLUGIN_INLINE static inline
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 # elif defined(__GNUC__)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 /* This is GCC running in C89 mode */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 # define ORTHANC_PLUGIN_INLINE static __inline
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 # elif defined(_MSC_VER)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 /* This is Visual Studio running in C89 mode */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 # define ORTHANC_PLUGIN_INLINE static __inline
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 # else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 # error Your compiler is not known to support the "inline" keyword
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 # endif
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 #endif
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169 /********************************************************************
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170 ** Inclusion of standard libraries.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171 ********************************************************************/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
173 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174 * For Microsoft Visual Studio, a compatibility "stdint.h" can be
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175 * downloaded at the following URL:
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
176 * https://orthanc.googlecode.com/hg/Resources/ThirdParty/VisualStudio/stdint.h
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
178 #include <stdint.h>
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
179
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
180 #include <stdlib.h>
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
183
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
184 /********************************************************************
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
185 ** Definition of the Orthanc Plugin API.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
186 ********************************************************************/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
188 /** @{ */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
189
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
190 #ifdef __cplusplus
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
191 extern "C"
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
192 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
193 #endif
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
194
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
196 * The various error codes that can be returned by the Orthanc core.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
198 typedef enum
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
199 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200 OrthancPluginErrorCode_InternalError = -1 /*!< Internal error */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
201 OrthancPluginErrorCode_Success = 0 /*!< Success */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
202 OrthancPluginErrorCode_Plugin = 1 /*!< Error encountered within the plugin engine */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
203 OrthancPluginErrorCode_NotImplemented = 2 /*!< Not implemented yet */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
204 OrthancPluginErrorCode_ParameterOutOfRange = 3 /*!< Parameter out of range */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
205 OrthancPluginErrorCode_NotEnoughMemory = 4 /*!< The server hosting Orthanc is running out of memory */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
206 OrthancPluginErrorCode_BadParameterType = 5 /*!< Bad type for a parameter */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
207 OrthancPluginErrorCode_BadSequenceOfCalls = 6 /*!< Bad sequence of calls */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
208 OrthancPluginErrorCode_InexistentItem = 7 /*!< Accessing an inexistent item */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
209 OrthancPluginErrorCode_BadRequest = 8 /*!< Bad request */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
210 OrthancPluginErrorCode_NetworkProtocol = 9 /*!< Error in the network protocol */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
211 OrthancPluginErrorCode_SystemCommand = 10 /*!< Error while calling a system command */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
212 OrthancPluginErrorCode_Database = 11 /*!< Error with the database engine */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
213 OrthancPluginErrorCode_UriSyntax = 12 /*!< Badly formatted URI */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
214 OrthancPluginErrorCode_InexistentFile = 13 /*!< Inexistent file */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
215 OrthancPluginErrorCode_CannotWriteFile = 14 /*!< Cannot write to file */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
216 OrthancPluginErrorCode_BadFileFormat = 15 /*!< Bad file format */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
217 OrthancPluginErrorCode_Timeout = 16 /*!< Timeout */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
218 OrthancPluginErrorCode_UnknownResource = 17 /*!< Unknown resource */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
219 OrthancPluginErrorCode_IncompatibleDatabaseVersion = 18 /*!< Incompatible version of the database */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
220 OrthancPluginErrorCode_FullStorage = 19 /*!< The file storage is full */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
221 OrthancPluginErrorCode_CorruptedFile = 20 /*!< Corrupted file (e.g. inconsistent MD5 hash) */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
222 OrthancPluginErrorCode_InexistentTag = 21 /*!< Inexistent tag */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
223 OrthancPluginErrorCode_ReadOnly = 22 /*!< Cannot modify a read-only data structure */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
224 OrthancPluginErrorCode_IncompatibleImageFormat = 23 /*!< Incompatible format of the images */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
225 OrthancPluginErrorCode_IncompatibleImageSize = 24 /*!< Incompatible size of the images */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
226 OrthancPluginErrorCode_SharedLibrary = 25 /*!< Error while using a shared library (plugin) */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
227 OrthancPluginErrorCode_UnknownPluginService = 26 /*!< Plugin invoking an unknown service */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
228 OrthancPluginErrorCode_UnknownDicomTag = 27 /*!< Unknown DICOM tag */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
229 OrthancPluginErrorCode_BadJson = 28 /*!< Cannot parse a JSON document */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
230 OrthancPluginErrorCode_Unauthorized = 29 /*!< Bad credentials were provided to an HTTP request */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
231 OrthancPluginErrorCode_BadFont = 30 /*!< Badly formatted font file */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
232 OrthancPluginErrorCode_DatabasePlugin = 31 /*!< The plugin implementing a custom database back-end does not fulfill the proper interface */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
233 OrthancPluginErrorCode_StorageAreaPlugin = 32 /*!< Error in the plugin implementing a custom storage area */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
234 OrthancPluginErrorCode_EmptyRequest = 33 /*!< The request is empty */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
235 OrthancPluginErrorCode_NotAcceptable = 34 /*!< Cannot send a response which is acceptable according to the Accept HTTP header */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
236 OrthancPluginErrorCode_NullPointer = 35 /*!< Cannot handle a NULL pointer */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
237 OrthancPluginErrorCode_DatabaseUnavailable = 36 /*!< The database is currently not available (probably a transient situation) */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
238 OrthancPluginErrorCode_CanceledJob = 37 /*!< This job was canceled */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
239 OrthancPluginErrorCode_SQLiteNotOpened = 1000 /*!< SQLite: The database is not opened */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
240 OrthancPluginErrorCode_SQLiteAlreadyOpened = 1001 /*!< SQLite: Connection is already open */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
241 OrthancPluginErrorCode_SQLiteCannotOpen = 1002 /*!< SQLite: Unable to open the database */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
242 OrthancPluginErrorCode_SQLiteStatementAlreadyUsed = 1003 /*!< SQLite: This cached statement is already being referred to */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
243 OrthancPluginErrorCode_SQLiteExecute = 1004 /*!< SQLite: Cannot execute a command */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
244 OrthancPluginErrorCode_SQLiteRollbackWithoutTransaction = 1005 /*!< SQLite: Rolling back a nonexistent transaction (have you called Begin()?) */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
245 OrthancPluginErrorCode_SQLiteCommitWithoutTransaction = 1006 /*!< SQLite: Committing a nonexistent transaction */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
246 OrthancPluginErrorCode_SQLiteRegisterFunction = 1007 /*!< SQLite: Unable to register a function */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
247 OrthancPluginErrorCode_SQLiteFlush = 1008 /*!< SQLite: Unable to flush the database */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
248 OrthancPluginErrorCode_SQLiteCannotRun = 1009 /*!< SQLite: Cannot run a cached statement */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
249 OrthancPluginErrorCode_SQLiteCannotStep = 1010 /*!< SQLite: Cannot step over a cached statement */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
250 OrthancPluginErrorCode_SQLiteBindOutOfRange = 1011 /*!< SQLite: Bing a value while out of range (serious error) */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
251 OrthancPluginErrorCode_SQLitePrepareStatement = 1012 /*!< SQLite: Cannot prepare a cached statement */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
252 OrthancPluginErrorCode_SQLiteTransactionAlreadyStarted = 1013 /*!< SQLite: Beginning the same transaction twice */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
253 OrthancPluginErrorCode_SQLiteTransactionCommit = 1014 /*!< SQLite: Failure when committing the transaction */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
254 OrthancPluginErrorCode_SQLiteTransactionBegin = 1015 /*!< SQLite: Cannot start a transaction */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
255 OrthancPluginErrorCode_DirectoryOverFile = 2000 /*!< The directory to be created is already occupied by a regular file */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
256 OrthancPluginErrorCode_FileStorageCannotWrite = 2001 /*!< Unable to create a subdirectory or a file in the file storage */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
257 OrthancPluginErrorCode_DirectoryExpected = 2002 /*!< The specified path does not point to a directory */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
258 OrthancPluginErrorCode_HttpPortInUse = 2003 /*!< The TCP port of the HTTP server is privileged or already in use */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
259 OrthancPluginErrorCode_DicomPortInUse = 2004 /*!< The TCP port of the DICOM server is privileged or already in use */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
260 OrthancPluginErrorCode_BadHttpStatusInRest = 2005 /*!< This HTTP status is not allowed in a REST API */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
261 OrthancPluginErrorCode_RegularFileExpected = 2006 /*!< The specified path does not point to a regular file */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
262 OrthancPluginErrorCode_PathToExecutable = 2007 /*!< Unable to get the path to the executable */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
263 OrthancPluginErrorCode_MakeDirectory = 2008 /*!< Cannot create a directory */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
264 OrthancPluginErrorCode_BadApplicationEntityTitle = 2009 /*!< An application entity title (AET) cannot be empty or be longer than 16 characters */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
265 OrthancPluginErrorCode_NoCFindHandler = 2010 /*!< No request handler factory for DICOM C-FIND SCP */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
266 OrthancPluginErrorCode_NoCMoveHandler = 2011 /*!< No request handler factory for DICOM C-MOVE SCP */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
267 OrthancPluginErrorCode_NoCStoreHandler = 2012 /*!< No request handler factory for DICOM C-STORE SCP */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
268 OrthancPluginErrorCode_NoApplicationEntityFilter = 2013 /*!< No application entity filter */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
269 OrthancPluginErrorCode_NoSopClassOrInstance = 2014 /*!< DicomUserConnection: Unable to find the SOP class and instance */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
270 OrthancPluginErrorCode_NoPresentationContext = 2015 /*!< DicomUserConnection: No acceptable presentation context for modality */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
271 OrthancPluginErrorCode_DicomFindUnavailable = 2016 /*!< DicomUserConnection: The C-FIND command is not supported by the remote SCP */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
272 OrthancPluginErrorCode_DicomMoveUnavailable = 2017 /*!< DicomUserConnection: The C-MOVE command is not supported by the remote SCP */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
273 OrthancPluginErrorCode_CannotStoreInstance = 2018 /*!< Cannot store an instance */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
274 OrthancPluginErrorCode_CreateDicomNotString = 2019 /*!< Only string values are supported when creating DICOM instances */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
275 OrthancPluginErrorCode_CreateDicomOverrideTag = 2020 /*!< Trying to override a value inherited from a parent module */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
276 OrthancPluginErrorCode_CreateDicomUseContent = 2021 /*!< Use \"Content\" to inject an image into a new DICOM instance */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
277 OrthancPluginErrorCode_CreateDicomNoPayload = 2022 /*!< No payload is present for one instance in the series */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
278 OrthancPluginErrorCode_CreateDicomUseDataUriScheme = 2023 /*!< The payload of the DICOM instance must be specified according to Data URI scheme */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
279 OrthancPluginErrorCode_CreateDicomBadParent = 2024 /*!< Trying to attach a new DICOM instance to an inexistent resource */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
280 OrthancPluginErrorCode_CreateDicomParentIsInstance = 2025 /*!< Trying to attach a new DICOM instance to an instance (must be a series, study or patient) */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
281 OrthancPluginErrorCode_CreateDicomParentEncoding = 2026 /*!< Unable to get the encoding of the parent resource */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
282 OrthancPluginErrorCode_UnknownModality = 2027 /*!< Unknown modality */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
283 OrthancPluginErrorCode_BadJobOrdering = 2028 /*!< Bad ordering of filters in a job */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
284 OrthancPluginErrorCode_JsonToLuaTable = 2029 /*!< Cannot convert the given JSON object to a Lua table */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
285 OrthancPluginErrorCode_CannotCreateLua = 2030 /*!< Cannot create the Lua context */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
286 OrthancPluginErrorCode_CannotExecuteLua = 2031 /*!< Cannot execute a Lua command */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
287 OrthancPluginErrorCode_LuaAlreadyExecuted = 2032 /*!< Arguments cannot be pushed after the Lua function is executed */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
288 OrthancPluginErrorCode_LuaBadOutput = 2033 /*!< The Lua function does not give the expected number of outputs */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
289 OrthancPluginErrorCode_NotLuaPredicate = 2034 /*!< The Lua function is not a predicate (only true/false outputs allowed) */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
290 OrthancPluginErrorCode_LuaReturnsNoString = 2035 /*!< The Lua function does not return a string */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
291 OrthancPluginErrorCode_StorageAreaAlreadyRegistered = 2036 /*!< Another plugin has already registered a custom storage area */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
292 OrthancPluginErrorCode_DatabaseBackendAlreadyRegistered = 2037 /*!< Another plugin has already registered a custom database back-end */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
293 OrthancPluginErrorCode_DatabaseNotInitialized = 2038 /*!< Plugin trying to call the database during its initialization */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
294 OrthancPluginErrorCode_SslDisabled = 2039 /*!< Orthanc has been built without SSL support */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
295 OrthancPluginErrorCode_CannotOrderSlices = 2040 /*!< Unable to order the slices of the series */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
296 OrthancPluginErrorCode_NoWorklistHandler = 2041 /*!< No request handler factory for DICOM C-Find Modality SCP */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
297 OrthancPluginErrorCode_AlreadyExistingTag = 2042 /*!< Cannot override the value of a tag that already exists */,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
298
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
299 _OrthancPluginErrorCode_INTERNAL = 0x7fffffff
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
300 } OrthancPluginErrorCode;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
301
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
302
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
303 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
304 * Forward declaration of one of the mandatory functions for Orthanc
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
305 * plugins.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
306 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
307 ORTHANC_PLUGINS_API const char* OrthancPluginGetName();
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
308
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
309
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
310 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
311 * The various HTTP methods for a REST call.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
312 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
313 typedef enum
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
314 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
315 OrthancPluginHttpMethod_Get = 1, /*!< GET request */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
316 OrthancPluginHttpMethod_Post = 2, /*!< POST request */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
317 OrthancPluginHttpMethod_Put = 3, /*!< PUT request */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
318 OrthancPluginHttpMethod_Delete = 4, /*!< DELETE request */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
319
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
320 _OrthancPluginHttpMethod_INTERNAL = 0x7fffffff
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
321 } OrthancPluginHttpMethod;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
322
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
323
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
324 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
325 * @brief The parameters of a REST request.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
326 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
327 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
328 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
329 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
330 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
331 * @brief The HTTP method.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
332 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
333 OrthancPluginHttpMethod method;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
334
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
335 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
336 * @brief The number of groups of the regular expression.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
337 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
338 uint32_t groupsCount;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
339
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
340 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
341 * @brief The matched values for the groups of the regular expression.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
342 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
343 const char* const* groups;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
344
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
345 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
346 * @brief For a GET request, the number of GET parameters.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
347 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
348 uint32_t getCount;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
349
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
350 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
351 * @brief For a GET request, the keys of the GET parameters.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
352 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
353 const char* const* getKeys;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
354
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
355 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
356 * @brief For a GET request, the values of the GET parameters.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
357 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
358 const char* const* getValues;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
359
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
360 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
361 * @brief For a PUT or POST request, the content of the body.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
362 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
363 const char* body;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
364
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
365 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
366 * @brief For a PUT or POST request, the number of bytes of the body.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
367 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
368 uint32_t bodySize;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
369
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
370
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
371 /* --------------------------------------------------
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
372 New in version 0.8.1
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
373 -------------------------------------------------- */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
374
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
375 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
376 * @brief The number of HTTP headers.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
377 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
378 uint32_t headersCount;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
379
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
380 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
381 * @brief The keys of the HTTP headers (always converted to low-case).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
382 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
383 const char* const* headersKeys;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
384
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
385 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
386 * @brief The values of the HTTP headers.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
387 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
388 const char* const* headersValues;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
389
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
390 } OrthancPluginHttpRequest;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
391
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
392
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
393 typedef enum
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
394 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
395 /* Generic services */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
396 _OrthancPluginService_LogInfo = 1,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
397 _OrthancPluginService_LogWarning = 2,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
398 _OrthancPluginService_LogError = 3,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
399 _OrthancPluginService_GetOrthancPath = 4,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
400 _OrthancPluginService_GetOrthancDirectory = 5,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
401 _OrthancPluginService_GetConfigurationPath = 6,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
402 _OrthancPluginService_SetPluginProperty = 7,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
403 _OrthancPluginService_GetGlobalProperty = 8,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
404 _OrthancPluginService_SetGlobalProperty = 9,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
405 _OrthancPluginService_GetCommandLineArgumentsCount = 10,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
406 _OrthancPluginService_GetCommandLineArgument = 11,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
407 _OrthancPluginService_GetExpectedDatabaseVersion = 12,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
408 _OrthancPluginService_GetConfiguration = 13,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
409 _OrthancPluginService_BufferCompression = 14,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
410 _OrthancPluginService_ReadFile = 15,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
411 _OrthancPluginService_WriteFile = 16,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
412 _OrthancPluginService_GetErrorDescription = 17,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
413 _OrthancPluginService_CallHttpClient = 18,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
414 _OrthancPluginService_RegisterErrorCode = 19,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
415 _OrthancPluginService_RegisterDictionaryTag = 20,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
416 _OrthancPluginService_DicomBufferToJson = 21,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
417 _OrthancPluginService_DicomInstanceToJson = 22,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
418 _OrthancPluginService_CreateDicom = 23,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
419 _OrthancPluginService_ComputeMd5 = 24,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
420 _OrthancPluginService_ComputeSha1 = 25,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
421 _OrthancPluginService_LookupDictionary = 26,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
422 _OrthancPluginService_CallHttpClient2 = 27,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
423 _OrthancPluginService_GenerateUuid = 28,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
424 _OrthancPluginService_RegisterPrivateDictionaryTag = 29,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
425
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
426 /* Registration of callbacks */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
427 _OrthancPluginService_RegisterRestCallback = 1000,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
428 _OrthancPluginService_RegisterOnStoredInstanceCallback = 1001,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
429 _OrthancPluginService_RegisterStorageArea = 1002,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
430 _OrthancPluginService_RegisterOnChangeCallback = 1003,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
431 _OrthancPluginService_RegisterRestCallbackNoLock = 1004,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
432 _OrthancPluginService_RegisterWorklistCallback = 1005,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
433 _OrthancPluginService_RegisterDecodeImageCallback = 1006,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
434 _OrthancPluginService_RegisterIncomingHttpRequestFilter = 1007,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
435 _OrthancPluginService_RegisterFindCallback = 1008,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
436 _OrthancPluginService_RegisterMoveCallback = 1009,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
437 _OrthancPluginService_RegisterIncomingHttpRequestFilter2 = 1010,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
438
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
439 /* Sending answers to REST calls */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
440 _OrthancPluginService_AnswerBuffer = 2000,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
441 _OrthancPluginService_CompressAndAnswerPngImage = 2001, /* Unused as of Orthanc 0.9.4 */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
442 _OrthancPluginService_Redirect = 2002,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
443 _OrthancPluginService_SendHttpStatusCode = 2003,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
444 _OrthancPluginService_SendUnauthorized = 2004,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
445 _OrthancPluginService_SendMethodNotAllowed = 2005,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
446 _OrthancPluginService_SetCookie = 2006,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
447 _OrthancPluginService_SetHttpHeader = 2007,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
448 _OrthancPluginService_StartMultipartAnswer = 2008,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
449 _OrthancPluginService_SendMultipartItem = 2009,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
450 _OrthancPluginService_SendHttpStatus = 2010,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
451 _OrthancPluginService_CompressAndAnswerImage = 2011,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
452 _OrthancPluginService_SendMultipartItem2 = 2012,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
453
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
454 /* Access to the Orthanc database and API */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
455 _OrthancPluginService_GetDicomForInstance = 3000,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
456 _OrthancPluginService_RestApiGet = 3001,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
457 _OrthancPluginService_RestApiPost = 3002,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
458 _OrthancPluginService_RestApiDelete = 3003,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
459 _OrthancPluginService_RestApiPut = 3004,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
460 _OrthancPluginService_LookupPatient = 3005,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
461 _OrthancPluginService_LookupStudy = 3006,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
462 _OrthancPluginService_LookupSeries = 3007,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
463 _OrthancPluginService_LookupInstance = 3008,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
464 _OrthancPluginService_LookupStudyWithAccessionNumber = 3009,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
465 _OrthancPluginService_RestApiGetAfterPlugins = 3010,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
466 _OrthancPluginService_RestApiPostAfterPlugins = 3011,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
467 _OrthancPluginService_RestApiDeleteAfterPlugins = 3012,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
468 _OrthancPluginService_RestApiPutAfterPlugins = 3013,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
469 _OrthancPluginService_ReconstructMainDicomTags = 3014,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
470 _OrthancPluginService_RestApiGet2 = 3015,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
471
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
472 /* Access to DICOM instances */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
473 _OrthancPluginService_GetInstanceRemoteAet = 4000,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
474 _OrthancPluginService_GetInstanceSize = 4001,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
475 _OrthancPluginService_GetInstanceData = 4002,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
476 _OrthancPluginService_GetInstanceJson = 4003,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
477 _OrthancPluginService_GetInstanceSimplifiedJson = 4004,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
478 _OrthancPluginService_HasInstanceMetadata = 4005,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
479 _OrthancPluginService_GetInstanceMetadata = 4006,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
480 _OrthancPluginService_GetInstanceOrigin = 4007,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
481
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
482 /* Services for plugins implementing a database back-end */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
483 _OrthancPluginService_RegisterDatabaseBackend = 5000,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
484 _OrthancPluginService_DatabaseAnswer = 5001,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
485 _OrthancPluginService_RegisterDatabaseBackendV2 = 5002,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
486 _OrthancPluginService_StorageAreaCreate = 5003,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
487 _OrthancPluginService_StorageAreaRead = 5004,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
488 _OrthancPluginService_StorageAreaRemove = 5005,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
489
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
490 /* Primitives for handling images */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
491 _OrthancPluginService_GetImagePixelFormat = 6000,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
492 _OrthancPluginService_GetImageWidth = 6001,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
493 _OrthancPluginService_GetImageHeight = 6002,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
494 _OrthancPluginService_GetImagePitch = 6003,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
495 _OrthancPluginService_GetImageBuffer = 6004,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
496 _OrthancPluginService_UncompressImage = 6005,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
497 _OrthancPluginService_FreeImage = 6006,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
498 _OrthancPluginService_CompressImage = 6007,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
499 _OrthancPluginService_ConvertPixelFormat = 6008,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
500 _OrthancPluginService_GetFontsCount = 6009,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
501 _OrthancPluginService_GetFontInfo = 6010,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
502 _OrthancPluginService_DrawText = 6011,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
503 _OrthancPluginService_CreateImage = 6012,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
504 _OrthancPluginService_CreateImageAccessor = 6013,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
505 _OrthancPluginService_DecodeDicomImage = 6014,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
506
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
507 /* Primitives for handling C-Find, C-Move and worklists */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
508 _OrthancPluginService_WorklistAddAnswer = 7000,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
509 _OrthancPluginService_WorklistMarkIncomplete = 7001,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
510 _OrthancPluginService_WorklistIsMatch = 7002,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
511 _OrthancPluginService_WorklistGetDicomQuery = 7003,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
512 _OrthancPluginService_FindAddAnswer = 7004,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
513 _OrthancPluginService_FindMarkIncomplete = 7005,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
514 _OrthancPluginService_GetFindQuerySize = 7006,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
515 _OrthancPluginService_GetFindQueryTag = 7007,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
516 _OrthancPluginService_GetFindQueryTagName = 7008,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
517 _OrthancPluginService_GetFindQueryValue = 7009,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
518 _OrthancPluginService_CreateFindMatcher = 7010,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
519 _OrthancPluginService_FreeFindMatcher = 7011,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
520 _OrthancPluginService_FindMatcherIsMatch = 7012,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
521
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
522 _OrthancPluginService_INTERNAL = 0x7fffffff
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
523 } _OrthancPluginService;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
524
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
525
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
526 typedef enum
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
527 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
528 _OrthancPluginProperty_Description = 1,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
529 _OrthancPluginProperty_RootUri = 2,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
530 _OrthancPluginProperty_OrthancExplorer = 3,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
531
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
532 _OrthancPluginProperty_INTERNAL = 0x7fffffff
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
533 } _OrthancPluginProperty;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
534
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
535
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
536
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
537 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
538 * The memory layout of the pixels of an image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
539 * @ingroup Images
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
540 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
541 typedef enum
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
542 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
543 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
544 * @brief Graylevel 8bpp image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
545 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
546 * The image is graylevel. Each pixel is unsigned and stored in
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
547 * one byte.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
548 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
549 OrthancPluginPixelFormat_Grayscale8 = 1,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
550
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
551 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
552 * @brief Graylevel, unsigned 16bpp image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
553 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
554 * The image is graylevel. Each pixel is unsigned and stored in
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
555 * two bytes.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
556 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
557 OrthancPluginPixelFormat_Grayscale16 = 2,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
558
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
559 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
560 * @brief Graylevel, signed 16bpp image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
561 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
562 * The image is graylevel. Each pixel is signed and stored in two
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
563 * bytes.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
564 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
565 OrthancPluginPixelFormat_SignedGrayscale16 = 3,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
566
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
567 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
568 * @brief Color image in RGB24 format.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
569 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
570 * This format describes a color image. The pixels are stored in 3
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
571 * consecutive bytes. The memory layout is RGB.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
572 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
573 OrthancPluginPixelFormat_RGB24 = 4,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
574
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
575 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
576 * @brief Color image in RGBA32 format.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
577 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
578 * This format describes a color image. The pixels are stored in 4
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
579 * consecutive bytes. The memory layout is RGBA.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
580 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
581 OrthancPluginPixelFormat_RGBA32 = 5,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
582
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
583 OrthancPluginPixelFormat_Unknown = 6, /*!< Unknown pixel format */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
584
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
585 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
586 * @brief Color image in RGB48 format.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
587 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
588 * This format describes a color image. The pixels are stored in 6
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
589 * consecutive bytes. The memory layout is RRGGBB.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
590 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
591 OrthancPluginPixelFormat_RGB48 = 7,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
592
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
593 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
594 * @brief Graylevel, unsigned 32bpp image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
595 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
596 * The image is graylevel. Each pixel is unsigned and stored in
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
597 * four bytes.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
598 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
599 OrthancPluginPixelFormat_Grayscale32 = 8,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
600
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
601 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
602 * @brief Graylevel, floating-point 32bpp image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
603 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
604 * The image is graylevel. Each pixel is floating-point and stored
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
605 * in four bytes.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
606 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
607 OrthancPluginPixelFormat_Float32 = 9,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
608
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
609 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
610 * @brief Color image in BGRA32 format.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
611 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
612 * This format describes a color image. The pixels are stored in 4
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
613 * consecutive bytes. The memory layout is BGRA.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
614 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
615 OrthancPluginPixelFormat_BGRA32 = 10,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
616
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
617 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
618 * @brief Graylevel, unsigned 64bpp image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
619 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
620 * The image is graylevel. Each pixel is unsigned and stored in
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
621 * eight bytes.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
622 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
623 OrthancPluginPixelFormat_Grayscale64 = 11,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
624
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
625 _OrthancPluginPixelFormat_INTERNAL = 0x7fffffff
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
626 } OrthancPluginPixelFormat;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
627
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
628
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
629
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
630 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
631 * The content types that are supported by Orthanc plugins.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
632 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
633 typedef enum
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
634 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
635 OrthancPluginContentType_Unknown = 0, /*!< Unknown content type */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
636 OrthancPluginContentType_Dicom = 1, /*!< DICOM */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
637 OrthancPluginContentType_DicomAsJson = 2, /*!< JSON summary of a DICOM file */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
638
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
639 _OrthancPluginContentType_INTERNAL = 0x7fffffff
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
640 } OrthancPluginContentType;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
641
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
642
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
643
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
644 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
645 * The supported types of DICOM resources.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
646 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
647 typedef enum
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
648 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
649 OrthancPluginResourceType_Patient = 0, /*!< Patient */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
650 OrthancPluginResourceType_Study = 1, /*!< Study */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
651 OrthancPluginResourceType_Series = 2, /*!< Series */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
652 OrthancPluginResourceType_Instance = 3, /*!< Instance */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
653 OrthancPluginResourceType_None = 4, /*!< Unavailable resource type */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
654
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
655 _OrthancPluginResourceType_INTERNAL = 0x7fffffff
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
656 } OrthancPluginResourceType;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
657
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
658
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
659
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
660 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
661 * The supported types of changes that can happen to DICOM resources.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
662 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
663 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
664 typedef enum
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
665 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
666 OrthancPluginChangeType_CompletedSeries = 0, /*!< Series is now complete */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
667 OrthancPluginChangeType_Deleted = 1, /*!< Deleted resource */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
668 OrthancPluginChangeType_NewChildInstance = 2, /*!< A new instance was added to this resource */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
669 OrthancPluginChangeType_NewInstance = 3, /*!< New instance received */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
670 OrthancPluginChangeType_NewPatient = 4, /*!< New patient created */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
671 OrthancPluginChangeType_NewSeries = 5, /*!< New series created */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
672 OrthancPluginChangeType_NewStudy = 6, /*!< New study created */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
673 OrthancPluginChangeType_StablePatient = 7, /*!< Timeout: No new instance in this patient */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
674 OrthancPluginChangeType_StableSeries = 8, /*!< Timeout: No new instance in this series */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
675 OrthancPluginChangeType_StableStudy = 9, /*!< Timeout: No new instance in this study */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
676 OrthancPluginChangeType_OrthancStarted = 10, /*!< Orthanc has started */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
677 OrthancPluginChangeType_OrthancStopped = 11, /*!< Orthanc is stopping */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
678 OrthancPluginChangeType_UpdatedAttachment = 12, /*!< Some user-defined attachment has changed for this resource */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
679 OrthancPluginChangeType_UpdatedMetadata = 13, /*!< Some user-defined metadata has changed for this resource */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
680
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
681 _OrthancPluginChangeType_INTERNAL = 0x7fffffff
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
682 } OrthancPluginChangeType;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
683
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
684
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
685 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
686 * The compression algorithms that are supported by the Orthanc core.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
687 * @ingroup Images
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
688 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
689 typedef enum
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
690 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
691 OrthancPluginCompressionType_Zlib = 0, /*!< Standard zlib compression */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
692 OrthancPluginCompressionType_ZlibWithSize = 1, /*!< zlib, prefixed with uncompressed size (uint64_t) */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
693 OrthancPluginCompressionType_Gzip = 2, /*!< Standard gzip compression */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
694 OrthancPluginCompressionType_GzipWithSize = 3, /*!< gzip, prefixed with uncompressed size (uint64_t) */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
695
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
696 _OrthancPluginCompressionType_INTERNAL = 0x7fffffff
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
697 } OrthancPluginCompressionType;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
698
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
699
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
700 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
701 * The image formats that are supported by the Orthanc core.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
702 * @ingroup Images
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
703 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
704 typedef enum
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
705 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
706 OrthancPluginImageFormat_Png = 0, /*!< Image compressed using PNG */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
707 OrthancPluginImageFormat_Jpeg = 1, /*!< Image compressed using JPEG */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
708 OrthancPluginImageFormat_Dicom = 2, /*!< Image compressed using DICOM */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
709
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
710 _OrthancPluginImageFormat_INTERNAL = 0x7fffffff
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
711 } OrthancPluginImageFormat;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
712
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
713
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
714 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
715 * The value representations present in the DICOM standard (version 2013).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
716 * @ingroup Toolbox
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
717 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
718 typedef enum
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
719 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
720 OrthancPluginValueRepresentation_AE = 1, /*!< Application Entity */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
721 OrthancPluginValueRepresentation_AS = 2, /*!< Age String */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
722 OrthancPluginValueRepresentation_AT = 3, /*!< Attribute Tag */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
723 OrthancPluginValueRepresentation_CS = 4, /*!< Code String */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
724 OrthancPluginValueRepresentation_DA = 5, /*!< Date */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
725 OrthancPluginValueRepresentation_DS = 6, /*!< Decimal String */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
726 OrthancPluginValueRepresentation_DT = 7, /*!< Date Time */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
727 OrthancPluginValueRepresentation_FD = 8, /*!< Floating Point Double */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
728 OrthancPluginValueRepresentation_FL = 9, /*!< Floating Point Single */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
729 OrthancPluginValueRepresentation_IS = 10, /*!< Integer String */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
730 OrthancPluginValueRepresentation_LO = 11, /*!< Long String */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
731 OrthancPluginValueRepresentation_LT = 12, /*!< Long Text */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
732 OrthancPluginValueRepresentation_OB = 13, /*!< Other Byte String */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
733 OrthancPluginValueRepresentation_OF = 14, /*!< Other Float String */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
734 OrthancPluginValueRepresentation_OW = 15, /*!< Other Word String */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
735 OrthancPluginValueRepresentation_PN = 16, /*!< Person Name */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
736 OrthancPluginValueRepresentation_SH = 17, /*!< Short String */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
737 OrthancPluginValueRepresentation_SL = 18, /*!< Signed Long */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
738 OrthancPluginValueRepresentation_SQ = 19, /*!< Sequence of Items */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
739 OrthancPluginValueRepresentation_SS = 20, /*!< Signed Short */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
740 OrthancPluginValueRepresentation_ST = 21, /*!< Short Text */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
741 OrthancPluginValueRepresentation_TM = 22, /*!< Time */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
742 OrthancPluginValueRepresentation_UI = 23, /*!< Unique Identifier (UID) */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
743 OrthancPluginValueRepresentation_UL = 24, /*!< Unsigned Long */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
744 OrthancPluginValueRepresentation_UN = 25, /*!< Unknown */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
745 OrthancPluginValueRepresentation_US = 26, /*!< Unsigned Short */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
746 OrthancPluginValueRepresentation_UT = 27, /*!< Unlimited Text */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
747
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
748 _OrthancPluginValueRepresentation_INTERNAL = 0x7fffffff
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
749 } OrthancPluginValueRepresentation;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
750
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
751
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
752 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
753 * The possible output formats for a DICOM-to-JSON conversion.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
754 * @ingroup Toolbox
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
755 * @see OrthancPluginDicomToJson()
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
756 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
757 typedef enum
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
758 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
759 OrthancPluginDicomToJsonFormat_Full = 1, /*!< Full output, with most details */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
760 OrthancPluginDicomToJsonFormat_Short = 2, /*!< Tags output as hexadecimal numbers */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
761 OrthancPluginDicomToJsonFormat_Human = 3, /*!< Human-readable JSON */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
762
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
763 _OrthancPluginDicomToJsonFormat_INTERNAL = 0x7fffffff
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
764 } OrthancPluginDicomToJsonFormat;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
765
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
766
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
767 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
768 * Flags to customize a DICOM-to-JSON conversion. By default, binary
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
769 * tags are formatted using Data URI scheme.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
770 * @ingroup Toolbox
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
771 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
772 typedef enum
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
773 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
774 OrthancPluginDicomToJsonFlags_None = 0,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
775 OrthancPluginDicomToJsonFlags_IncludeBinary = (1 << 0), /*!< Include the binary tags */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
776 OrthancPluginDicomToJsonFlags_IncludePrivateTags = (1 << 1), /*!< Include the private tags */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
777 OrthancPluginDicomToJsonFlags_IncludeUnknownTags = (1 << 2), /*!< Include the tags unknown by the dictionary */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
778 OrthancPluginDicomToJsonFlags_IncludePixelData = (1 << 3), /*!< Include the pixel data */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
779 OrthancPluginDicomToJsonFlags_ConvertBinaryToAscii = (1 << 4), /*!< Output binary tags as-is, dropping non-ASCII */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
780 OrthancPluginDicomToJsonFlags_ConvertBinaryToNull = (1 << 5), /*!< Signal binary tags as null values */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
781
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
782 _OrthancPluginDicomToJsonFlags_INTERNAL = 0x7fffffff
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
783 } OrthancPluginDicomToJsonFlags;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
784
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
785
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
786 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
787 * Flags to the creation of a DICOM file.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
788 * @ingroup Toolbox
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
789 * @see OrthancPluginCreateDicom()
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
790 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
791 typedef enum
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
792 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
793 OrthancPluginCreateDicomFlags_None = 0,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
794 OrthancPluginCreateDicomFlags_DecodeDataUriScheme = (1 << 0), /*!< Decode fields encoded using data URI scheme */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
795 OrthancPluginCreateDicomFlags_GenerateIdentifiers = (1 << 1), /*!< Automatically generate DICOM identifiers */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
796
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
797 _OrthancPluginCreateDicomFlags_INTERNAL = 0x7fffffff
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
798 } OrthancPluginCreateDicomFlags;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
799
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
800
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
801 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
802 * The constraints on the DICOM identifiers that must be supported
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
803 * by the database plugins.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
804 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
805 typedef enum
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
806 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
807 OrthancPluginIdentifierConstraint_Equal = 1, /*!< Equal */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
808 OrthancPluginIdentifierConstraint_SmallerOrEqual = 2, /*!< Less or equal */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
809 OrthancPluginIdentifierConstraint_GreaterOrEqual = 3, /*!< More or equal */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
810 OrthancPluginIdentifierConstraint_Wildcard = 4, /*!< Case-sensitive wildcard matching (with * and ?) */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
811
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
812 _OrthancPluginIdentifierConstraint_INTERNAL = 0x7fffffff
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
813 } OrthancPluginIdentifierConstraint;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
814
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
815
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
816 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
817 * The origin of a DICOM instance that has been received by Orthanc.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
818 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
819 typedef enum
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
820 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
821 OrthancPluginInstanceOrigin_Unknown = 1, /*!< Unknown origin */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
822 OrthancPluginInstanceOrigin_DicomProtocol = 2, /*!< Instance received through DICOM protocol */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
823 OrthancPluginInstanceOrigin_RestApi = 3, /*!< Instance received through REST API of Orthanc */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
824 OrthancPluginInstanceOrigin_Plugin = 4, /*!< Instance added to Orthanc by a plugin */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
825 OrthancPluginInstanceOrigin_Lua = 5, /*!< Instance added to Orthanc by a Lua script */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
826
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
827 _OrthancPluginInstanceOrigin_INTERNAL = 0x7fffffff
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
828 } OrthancPluginInstanceOrigin;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
829
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
830
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
831 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
832 * @brief A memory buffer allocated by the core system of Orthanc.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
833 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
834 * A memory buffer allocated by the core system of Orthanc. When the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
835 * content of the buffer is not useful anymore, it must be free by a
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
836 * call to ::OrthancPluginFreeMemoryBuffer().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
837 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
838 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
839 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
840 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
841 * @brief The content of the buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
842 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
843 void* data;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
844
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
845 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
846 * @brief The number of bytes in the buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
847 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
848 uint32_t size;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
849 } OrthancPluginMemoryBuffer;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
850
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
851
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
852
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
853
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
854 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
855 * @brief Opaque structure that represents the HTTP connection to the client application.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
856 * @ingroup Callback
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
857 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
858 typedef struct _OrthancPluginRestOutput_t OrthancPluginRestOutput;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
859
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
860
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
861
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
862 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
863 * @brief Opaque structure that represents a DICOM instance received by Orthanc.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
864 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
865 typedef struct _OrthancPluginDicomInstance_t OrthancPluginDicomInstance;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
866
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
867
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
868
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
869 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
870 * @brief Opaque structure that represents an image that is uncompressed in memory.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
871 * @ingroup Images
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
872 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
873 typedef struct _OrthancPluginImage_t OrthancPluginImage;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
874
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
875
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
876
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
877 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
878 * @brief Opaque structure that represents the storage area that is actually used by Orthanc.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
879 * @ingroup Images
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
880 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
881 typedef struct _OrthancPluginStorageArea_t OrthancPluginStorageArea;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
882
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
883
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
884
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
885 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
886 * @brief Opaque structure to an object that represents a C-Find query for worklists.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
887 * @ingroup DicomCallbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
888 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
889 typedef struct _OrthancPluginWorklistQuery_t OrthancPluginWorklistQuery;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
890
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
891
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
892
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
893 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
894 * @brief Opaque structure to an object that represents the answers to a C-Find query for worklists.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
895 * @ingroup DicomCallbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
896 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
897 typedef struct _OrthancPluginWorklistAnswers_t OrthancPluginWorklistAnswers;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
898
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
899
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
900
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
901 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
902 * @brief Opaque structure to an object that represents a C-Find query.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
903 * @ingroup DicomCallbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
904 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
905 typedef struct _OrthancPluginFindQuery_t OrthancPluginFindQuery;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
906
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
907
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
908
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
909 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
910 * @brief Opaque structure to an object that represents the answers to a C-Find query for worklists.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
911 * @ingroup DicomCallbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
912 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
913 typedef struct _OrthancPluginFindAnswers_t OrthancPluginFindAnswers;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
914
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
915
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
916
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
917 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
918 * @brief Opaque structure to an object that can be used to check whether a DICOM instance matches a C-Find query.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
919 * @ingroup Toolbox
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
920 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
921 typedef struct _OrthancPluginFindAnswers_t OrthancPluginFindMatcher;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
922
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
923
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
924
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
925 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
926 * @brief Signature of a callback function that answers to a REST request.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
927 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
928 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
929 typedef OrthancPluginErrorCode (*OrthancPluginRestCallback) (
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
930 OrthancPluginRestOutput* output,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
931 const char* url,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
932 const OrthancPluginHttpRequest* request);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
933
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
934
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
935
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
936 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
937 * @brief Signature of a callback function that is triggered when Orthanc receives a DICOM instance.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
938 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
939 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
940 typedef OrthancPluginErrorCode (*OrthancPluginOnStoredInstanceCallback) (
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
941 OrthancPluginDicomInstance* instance,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
942 const char* instanceId);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
943
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
944
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
945
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
946 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
947 * @brief Signature of a callback function that is triggered when a change happens to some DICOM resource.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
948 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
949 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
950 typedef OrthancPluginErrorCode (*OrthancPluginOnChangeCallback) (
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
951 OrthancPluginChangeType changeType,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
952 OrthancPluginResourceType resourceType,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
953 const char* resourceId);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
954
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
955
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
956
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
957 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
958 * @brief Signature of a callback function to decode a DICOM instance as an image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
959 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
960 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
961 typedef OrthancPluginErrorCode (*OrthancPluginDecodeImageCallback) (
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
962 OrthancPluginImage** target,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
963 const void* dicom,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
964 const uint32_t size,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
965 uint32_t frameIndex);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
966
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
967
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
968
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
969 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
970 * @brief Signature of a function to free dynamic memory.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
971 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
972 typedef void (*OrthancPluginFree) (void* buffer);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
973
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
974
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
975
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
976 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
977 * @brief Callback for writing to the storage area.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
978 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
979 * Signature of a callback function that is triggered when Orthanc writes a file to the storage area.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
980 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
981 * @param uuid The UUID of the file.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
982 * @param content The content of the file.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
983 * @param size The size of the file.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
984 * @param type The content type corresponding to this file.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
985 * @return 0 if success, other value if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
986 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
987 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
988 typedef OrthancPluginErrorCode (*OrthancPluginStorageCreate) (
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
989 const char* uuid,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
990 const void* content,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
991 int64_t size,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
992 OrthancPluginContentType type);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
993
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
994
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
995
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
996 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
997 * @brief Callback for reading from the storage area.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
998 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
999 * Signature of a callback function that is triggered when Orthanc reads a file from the storage area.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1000 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1001 * @param content The content of the file (output).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1002 * @param size The size of the file (output).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1003 * @param uuid The UUID of the file of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1004 * @param type The content type corresponding to this file.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1005 * @return 0 if success, other value if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1006 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1007 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1008 typedef OrthancPluginErrorCode (*OrthancPluginStorageRead) (
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1009 void** content,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1010 int64_t* size,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1011 const char* uuid,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1012 OrthancPluginContentType type);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1013
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1014
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1015
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1016 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1017 * @brief Callback for removing a file from the storage area.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1018 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1019 * Signature of a callback function that is triggered when Orthanc deletes a file from the storage area.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1020 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1021 * @param uuid The UUID of the file to be removed.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1022 * @param type The content type corresponding to this file.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1023 * @return 0 if success, other value if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1024 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1025 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1026 typedef OrthancPluginErrorCode (*OrthancPluginStorageRemove) (
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1027 const char* uuid,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1028 OrthancPluginContentType type);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1029
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1030
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1031
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1032 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1033 * @brief Callback to handle the C-Find SCP requests for worklists.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1034 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1035 * Signature of a callback function that is triggered when Orthanc
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1036 * receives a C-Find SCP request against modality worklists.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1037 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1038 * @param answers The target structure where answers must be stored.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1039 * @param query The worklist query.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1040 * @param issuerAet The Application Entity Title (AET) of the modality from which the request originates.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1041 * @param calledAet The Application Entity Title (AET) of the modality that is called by the request.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1042 * @return 0 if success, other value if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1043 * @ingroup DicomCallbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1044 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1045 typedef OrthancPluginErrorCode (*OrthancPluginWorklistCallback) (
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1046 OrthancPluginWorklistAnswers* answers,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1047 const OrthancPluginWorklistQuery* query,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1048 const char* issuerAet,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1049 const char* calledAet);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1050
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1051
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1052
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1053 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1054 * @brief Callback to filter incoming HTTP requests received by Orthanc.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1055 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1056 * Signature of a callback function that is triggered whenever
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1057 * Orthanc receives an HTTP/REST request, and that answers whether
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1058 * this request should be allowed. If the callback returns "0"
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1059 * ("false"), the server answers with HTTP status code 403
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1060 * (Forbidden).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1061 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1062 * @param method The HTTP method used by the request.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1063 * @param uri The URI of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1064 * @param ip The IP address of the HTTP client.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1065 * @param headersCount The number of HTTP headers.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1066 * @param headersKeys The keys of the HTTP headers (always converted to low-case).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1067 * @param headersValues The values of the HTTP headers.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1068 * @return 0 if forbidden access, 1 if allowed access, -1 if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1069 * @ingroup Callback
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1070 * @deprecated Please instead use OrthancPluginIncomingHttpRequestFilter2()
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1071 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1072 typedef int32_t (*OrthancPluginIncomingHttpRequestFilter) (
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1073 OrthancPluginHttpMethod method,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1074 const char* uri,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1075 const char* ip,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1076 uint32_t headersCount,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1077 const char* const* headersKeys,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1078 const char* const* headersValues);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1079
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1080
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1081
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1082 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1083 * @brief Callback to filter incoming HTTP requests received by Orthanc.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1084 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1085 * Signature of a callback function that is triggered whenever
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1086 * Orthanc receives an HTTP/REST request, and that answers whether
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1087 * this request should be allowed. If the callback returns "0"
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1088 * ("false"), the server answers with HTTP status code 403
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1089 * (Forbidden).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1090 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1091 * @param method The HTTP method used by the request.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1092 * @param uri The URI of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1093 * @param ip The IP address of the HTTP client.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1094 * @param headersCount The number of HTTP headers.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1095 * @param headersKeys The keys of the HTTP headers (always converted to low-case).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1096 * @param headersValues The values of the HTTP headers.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1097 * @param getArgumentsCount The number of GET arguments (only for the GET HTTP method).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1098 * @param getArgumentsKeys The keys of the GET arguments (only for the GET HTTP method).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1099 * @param getArgumentsValues The values of the GET arguments (only for the GET HTTP method).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1100 * @return 0 if forbidden access, 1 if allowed access, -1 if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1101 * @ingroup Callback
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1102 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1103 typedef int32_t (*OrthancPluginIncomingHttpRequestFilter2) (
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1104 OrthancPluginHttpMethod method,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1105 const char* uri,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1106 const char* ip,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1107 uint32_t headersCount,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1108 const char* const* headersKeys,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1109 const char* const* headersValues,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1110 uint32_t getArgumentsCount,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1111 const char* const* getArgumentsKeys,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1112 const char* const* getArgumentsValues);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1113
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1114
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1115
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1116 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1117 * @brief Callback to handle incoming C-Find SCP requests.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1118 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1119 * Signature of a callback function that is triggered whenever
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1120 * Orthanc receives a C-Find SCP request not concerning modality
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1121 * worklists.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1122 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1123 * @param answers The target structure where answers must be stored.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1124 * @param query The worklist query.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1125 * @param issuerAet The Application Entity Title (AET) of the modality from which the request originates.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1126 * @param calledAet The Application Entity Title (AET) of the modality that is called by the request.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1127 * @return 0 if success, other value if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1128 * @ingroup DicomCallbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1129 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1130 typedef OrthancPluginErrorCode (*OrthancPluginFindCallback) (
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1131 OrthancPluginFindAnswers* answers,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1132 const OrthancPluginFindQuery* query,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1133 const char* issuerAet,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1134 const char* calledAet);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1135
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1136
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1137
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1138 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1139 * @brief Callback to handle incoming C-Move SCP requests.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1140 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1141 * Signature of a callback function that is triggered whenever
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1142 * Orthanc receives a C-Move SCP request. The callback receives the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1143 * type of the resource of interest (study, series, instance...)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1144 * together with the DICOM tags containing its identifiers. In turn,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1145 * the plugin must create a driver object that will be responsible
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1146 * for driving the successive move suboperations.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1147 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1148 * @param resourceType The type of the resource of interest. Note
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1149 * that this might be set to ResourceType_None if the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1150 * QueryRetrieveLevel (0008,0052) tag was not provided by the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1151 * issuer (i.e. the originator modality).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1152 * @param patientId Content of the PatientID (0x0010, 0x0020) tag of the resource of interest. Might be NULL.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1153 * @param accessionNumber Content of the AccessionNumber (0x0008, 0x0050) tag. Might be NULL.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1154 * @param studyInstanceUid Content of the StudyInstanceUID (0x0020, 0x000d) tag. Might be NULL.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1155 * @param seriesInstanceUid Content of the SeriesInstanceUID (0x0020, 0x000e) tag. Might be NULL.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1156 * @param sopInstanceUid Content of the SOPInstanceUID (0x0008, 0x0018) tag. Might be NULL.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1157 * @param originatorAet The Application Entity Title (AET) of the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1158 * modality from which the request originates.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1159 * @param sourceAet The Application Entity Title (AET) of the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1160 * modality that should send its DICOM files to another modality.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1161 * @param targetAet The Application Entity Title (AET) of the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1162 * modality that should receive the DICOM files.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1163 * @param originatorId The Message ID issued by the originator modality,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1164 * as found in tag (0000,0110) of the DICOM query emitted by the issuer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1165 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1166 * @return The NULL value if the plugin cannot deal with this query,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1167 * or a pointer to the driver object that is responsible for
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1168 * handling the successive move suboperations.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1169 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1170 * @note If targetAet equals sourceAet, this is actually a query/retrieve operation.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1171 * @ingroup DicomCallbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1172 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1173 typedef void* (*OrthancPluginMoveCallback) (
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1174 OrthancPluginResourceType resourceType,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1175 const char* patientId,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1176 const char* accessionNumber,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1177 const char* studyInstanceUid,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1178 const char* seriesInstanceUid,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1179 const char* sopInstanceUid,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1180 const char* originatorAet,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1181 const char* sourceAet,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1182 const char* targetAet,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1183 uint16_t originatorId);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1184
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1185
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1186 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1187 * @brief Callback to read the size of a C-Move driver.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1188 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1189 * Signature of a callback function that returns the number of
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1190 * C-Move suboperations that are to be achieved by the given C-Move
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1191 * driver. This driver is the return value of a previous call to the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1192 * OrthancPluginMoveCallback() callback.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1193 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1194 * @param moveDriver The C-Move driver of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1195 * @return The number of suboperations.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1196 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1197 typedef uint32_t (*OrthancPluginGetMoveSize) (void* moveDriver);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1198
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1199
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1200 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1201 * @brief Callback to apply one C-Move suboperation.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1202 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1203 * Signature of a callback function that applies the next C-Move
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1204 * suboperation that os to be achieved by the given C-Move
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1205 * driver. This driver is the return value of a previous call to the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1206 * OrthancPluginMoveCallback() callback.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1207 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1208 * @param moveDriver The C-Move driver of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1209 * @return 0 if success, or the error code if failure.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1210 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1211 typedef OrthancPluginErrorCode (*OrthancPluginApplyMove) (void* moveDriver);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1212
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1213
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1214 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1215 * @brief Callback to free one C-Move driver.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1216 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1217 * Signature of a callback function that releases the resources
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1218 * allocated by the given C-Move driver. This driver is the return
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1219 * value of a previous call to the OrthancPluginMoveCallback()
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1220 * callback.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1221 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1222 * @param moveDriver The C-Move driver of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1223 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1224 typedef void (*OrthancPluginFreeMove) (void* moveDriver);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1225
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1226
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1227
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1228 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1229 * @brief Data structure that contains information about the Orthanc core.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1230 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1231 typedef struct _OrthancPluginContext_t
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1232 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1233 void* pluginsManager;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1234 const char* orthancVersion;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1235 OrthancPluginFree Free;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1236 OrthancPluginErrorCode (*InvokeService) (struct _OrthancPluginContext_t* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1237 _OrthancPluginService service,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1238 const void* params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1239 } OrthancPluginContext;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1240
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1241
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1242
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1243 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1244 * @brief An entry in the dictionary of DICOM tags.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1245 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1246 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1247 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1248 uint16_t group; /*!< The group of the tag */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1249 uint16_t element; /*!< The element of the tag */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1250 OrthancPluginValueRepresentation vr; /*!< The value representation of the tag */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1251 uint32_t minMultiplicity; /*!< The minimum multiplicity of the tag */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1252 uint32_t maxMultiplicity; /*!< The maximum multiplicity of the tag (0 means arbitrary) */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1253 } OrthancPluginDictionaryEntry;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1254
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1255
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1256
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1257 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1258 * @brief Free a string.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1259 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1260 * Free a string that was allocated by the core system of Orthanc.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1261 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1262 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1263 * @param str The string to be freed.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1264 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1265 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeString(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1266 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1267 char* str)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1268 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1269 if (str != NULL)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1270 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1271 context->Free(str);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1272 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1273 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1274
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1275
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1276 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1277 * @brief Check that the version of the hosting Orthanc is above a given version.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1278 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1279 * This function checks whether the version of the Orthanc server
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1280 * running this plugin, is above the given version. Contrarily to
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1281 * OrthancPluginCheckVersion(), it is up to the developer of the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1282 * plugin to make sure that all the Orthanc SDK services called by
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1283 * the plugin are actually implemented in the given version of
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1284 * Orthanc.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1285 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1286 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1287 * @return 1 if and only if the versions are compatible. If the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1288 * result is 0, the initialization of the plugin should fail.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1289 * @see OrthancPluginCheckVersion
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1290 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1291 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1292 ORTHANC_PLUGIN_INLINE int OrthancPluginCheckVersionAdvanced(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1293 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1294 int expectedMajor,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1295 int expectedMinor,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1296 int expectedRevision)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1297 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1298 int major, minor, revision;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1299
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1300 if (sizeof(int32_t) != sizeof(OrthancPluginErrorCode) ||
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1301 sizeof(int32_t) != sizeof(OrthancPluginHttpMethod) ||
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1302 sizeof(int32_t) != sizeof(_OrthancPluginService) ||
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1303 sizeof(int32_t) != sizeof(_OrthancPluginProperty) ||
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1304 sizeof(int32_t) != sizeof(OrthancPluginPixelFormat) ||
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1305 sizeof(int32_t) != sizeof(OrthancPluginContentType) ||
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1306 sizeof(int32_t) != sizeof(OrthancPluginResourceType) ||
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1307 sizeof(int32_t) != sizeof(OrthancPluginChangeType) ||
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1308 sizeof(int32_t) != sizeof(OrthancPluginCompressionType) ||
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1309 sizeof(int32_t) != sizeof(OrthancPluginImageFormat) ||
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1310 sizeof(int32_t) != sizeof(OrthancPluginValueRepresentation) ||
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1311 sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFormat) ||
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1312 sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFlags) ||
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1313 sizeof(int32_t) != sizeof(OrthancPluginCreateDicomFlags) ||
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1314 sizeof(int32_t) != sizeof(OrthancPluginIdentifierConstraint) ||
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1315 sizeof(int32_t) != sizeof(OrthancPluginInstanceOrigin))
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1316 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1317 /* Mismatch in the size of the enumerations */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1318 return 0;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1319 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1320
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1321 /* Assume compatibility with the mainline */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1322 if (!strcmp(context->orthancVersion, "mainline"))
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1323 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1324 return 1;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1325 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1326
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1327 /* Parse the version of the Orthanc core */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1328 if (
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1329 #ifdef _MSC_VER
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1330 sscanf_s
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1331 #else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1332 sscanf
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1333 #endif
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1334 (context->orthancVersion, "%4d.%4d.%4d", &major, &minor, &revision) != 3)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1335 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1336 return 0;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1337 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1338
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1339 /* Check the major number of the version */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1340
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1341 if (major > expectedMajor)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1342 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1343 return 1;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1344 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1345
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1346 if (major < expectedMajor)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1347 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1348 return 0;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1349 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1350
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1351 /* Check the minor number of the version */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1352
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1353 if (minor > expectedMinor)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1354 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1355 return 1;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1356 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1357
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1358 if (minor < expectedMinor)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1359 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1360 return 0;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1361 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1362
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1363 /* Check the revision number of the version */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1364
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1365 if (revision >= expectedRevision)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1366 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1367 return 1;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1368 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1369 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1370 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1371 return 0;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1372 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1373 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1374
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1375
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1376 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1377 * @brief Check the compatibility of the plugin wrt. the version of its hosting Orthanc.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1378 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1379 * This function checks whether the version of the Orthanc server
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1380 * running this plugin, is above the version of the current Orthanc
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1381 * SDK header. This guarantees that the plugin is compatible with
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1382 * the hosting Orthanc (i.e. it will not call unavailable services).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1383 * The result of this function should always be checked in the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1384 * OrthancPluginInitialize() entry point of the plugin.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1385 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1386 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1387 * @return 1 if and only if the versions are compatible. If the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1388 * result is 0, the initialization of the plugin should fail.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1389 * @see OrthancPluginCheckVersionAdvanced
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1390 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1391 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1392 ORTHANC_PLUGIN_INLINE int OrthancPluginCheckVersion(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1393 OrthancPluginContext* context)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1394 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1395 return OrthancPluginCheckVersionAdvanced(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1396 context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1397 ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1398 ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1399 ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1400 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1401
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1402
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1403 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1404 * @brief Free a memory buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1405 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1406 * Free a memory buffer that was allocated by the core system of Orthanc.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1407 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1408 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1409 * @param buffer The memory buffer to release.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1410 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1411 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeMemoryBuffer(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1412 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1413 OrthancPluginMemoryBuffer* buffer)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1414 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1415 context->Free(buffer->data);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1416 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1417
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1418
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1419 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1420 * @brief Log an error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1421 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1422 * Log an error message using the Orthanc logging system.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1423 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1424 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1425 * @param message The message to be logged.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1426 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1427 ORTHANC_PLUGIN_INLINE void OrthancPluginLogError(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1428 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1429 const char* message)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1430 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1431 context->InvokeService(context, _OrthancPluginService_LogError, message);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1432 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1433
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1434
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1435 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1436 * @brief Log a warning.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1437 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1438 * Log a warning message using the Orthanc logging system.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1439 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1440 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1441 * @param message The message to be logged.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1442 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1443 ORTHANC_PLUGIN_INLINE void OrthancPluginLogWarning(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1444 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1445 const char* message)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1446 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1447 context->InvokeService(context, _OrthancPluginService_LogWarning, message);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1448 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1449
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1450
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1451 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1452 * @brief Log an information.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1453 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1454 * Log an information message using the Orthanc logging system.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1455 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1456 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1457 * @param message The message to be logged.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1458 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1459 ORTHANC_PLUGIN_INLINE void OrthancPluginLogInfo(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1460 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1461 const char* message)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1462 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1463 context->InvokeService(context, _OrthancPluginService_LogInfo, message);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1464 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1465
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1466
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1467
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1468 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1469 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1470 const char* pathRegularExpression;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1471 OrthancPluginRestCallback callback;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1472 } _OrthancPluginRestCallback;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1473
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1474 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1475 * @brief Register a REST callback.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1476 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1477 * This function registers a REST callback against a regular
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1478 * expression for a URI. This function must be called during the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1479 * initialization of the plugin, i.e. inside the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1480 * OrthancPluginInitialize() public function.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1481 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1482 * Each REST callback is guaranteed to run in mutual exclusion.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1483 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1484 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1485 * @param pathRegularExpression Regular expression for the URI. May contain groups.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1486 * @param callback The callback function to handle the REST call.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1487 * @see OrthancPluginRegisterRestCallbackNoLock()
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1488 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1489 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1490 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallback(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1491 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1492 const char* pathRegularExpression,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1493 OrthancPluginRestCallback callback)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1494 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1495 _OrthancPluginRestCallback params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1496 params.pathRegularExpression = pathRegularExpression;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1497 params.callback = callback;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1498 context->InvokeService(context, _OrthancPluginService_RegisterRestCallback, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1499 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1500
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1501
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1502
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1503 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1504 * @brief Register a REST callback, without locking.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1505 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1506 * This function registers a REST callback against a regular
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1507 * expression for a URI. This function must be called during the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1508 * initialization of the plugin, i.e. inside the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1509 * OrthancPluginInitialize() public function.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1510 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1511 * Contrarily to OrthancPluginRegisterRestCallback(), the callback
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1512 * will NOT be invoked in mutual exclusion. This can be useful for
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1513 * high-performance plugins that must handle concurrent requests
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1514 * (Orthanc uses a pool of threads, one thread being assigned to
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1515 * each incoming HTTP request). Of course, it is up to the plugin to
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1516 * implement the required locking mechanisms.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1517 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1518 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1519 * @param pathRegularExpression Regular expression for the URI. May contain groups.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1520 * @param callback The callback function to handle the REST call.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1521 * @see OrthancPluginRegisterRestCallback()
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1522 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1523 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1524 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallbackNoLock(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1525 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1526 const char* pathRegularExpression,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1527 OrthancPluginRestCallback callback)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1528 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1529 _OrthancPluginRestCallback params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1530 params.pathRegularExpression = pathRegularExpression;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1531 params.callback = callback;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1532 context->InvokeService(context, _OrthancPluginService_RegisterRestCallbackNoLock, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1533 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1534
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1535
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1536
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1537 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1538 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1539 OrthancPluginOnStoredInstanceCallback callback;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1540 } _OrthancPluginOnStoredInstanceCallback;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1541
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1542 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1543 * @brief Register a callback for received instances.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1544 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1545 * This function registers a callback function that is called
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1546 * whenever a new DICOM instance is stored into the Orthanc core.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1547 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1548 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1549 * @param callback The callback function.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1550 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1551 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1552 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnStoredInstanceCallback(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1553 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1554 OrthancPluginOnStoredInstanceCallback callback)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1555 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1556 _OrthancPluginOnStoredInstanceCallback params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1557 params.callback = callback;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1558
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1559 context->InvokeService(context, _OrthancPluginService_RegisterOnStoredInstanceCallback, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1560 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1561
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1562
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1563
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1564 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1565 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1566 OrthancPluginRestOutput* output;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1567 const char* answer;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1568 uint32_t answerSize;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1569 const char* mimeType;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1570 } _OrthancPluginAnswerBuffer;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1571
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1572 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1573 * @brief Answer to a REST request.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1574 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1575 * This function answers to a REST request with the content of a memory buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1576 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1577 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1578 * @param output The HTTP connection to the client application.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1579 * @param answer Pointer to the memory buffer containing the answer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1580 * @param answerSize Number of bytes of the answer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1581 * @param mimeType The MIME type of the answer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1582 * @ingroup REST
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1583 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1584 ORTHANC_PLUGIN_INLINE void OrthancPluginAnswerBuffer(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1585 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1586 OrthancPluginRestOutput* output,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1587 const char* answer,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1588 uint32_t answerSize,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1589 const char* mimeType)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1590 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1591 _OrthancPluginAnswerBuffer params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1592 params.output = output;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1593 params.answer = answer;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1594 params.answerSize = answerSize;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1595 params.mimeType = mimeType;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1596 context->InvokeService(context, _OrthancPluginService_AnswerBuffer, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1597 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1598
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1599
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1600 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1601 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1602 OrthancPluginRestOutput* output;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1603 OrthancPluginPixelFormat format;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1604 uint32_t width;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1605 uint32_t height;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1606 uint32_t pitch;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1607 const void* buffer;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1608 } _OrthancPluginCompressAndAnswerPngImage;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1609
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1610 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1611 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1612 OrthancPluginRestOutput* output;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1613 OrthancPluginImageFormat imageFormat;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1614 OrthancPluginPixelFormat pixelFormat;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1615 uint32_t width;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1616 uint32_t height;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1617 uint32_t pitch;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1618 const void* buffer;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1619 uint8_t quality;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1620 } _OrthancPluginCompressAndAnswerImage;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1621
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1622
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1623 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1624 * @brief Answer to a REST request with a PNG image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1625 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1626 * This function answers to a REST request with a PNG image. The
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1627 * parameters of this function describe a memory buffer that
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1628 * contains an uncompressed image. The image will be automatically compressed
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1629 * as a PNG image by the core system of Orthanc.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1630 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1631 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1632 * @param output The HTTP connection to the client application.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1633 * @param format The memory layout of the uncompressed image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1634 * @param width The width of the image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1635 * @param height The height of the image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1636 * @param pitch The pitch of the image (i.e. the number of bytes
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1637 * between 2 successive lines of the image in the memory buffer).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1638 * @param buffer The memory buffer containing the uncompressed image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1639 * @ingroup REST
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1640 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1641 ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerPngImage(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1642 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1643 OrthancPluginRestOutput* output,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1644 OrthancPluginPixelFormat format,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1645 uint32_t width,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1646 uint32_t height,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1647 uint32_t pitch,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1648 const void* buffer)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1649 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1650 _OrthancPluginCompressAndAnswerImage params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1651 params.output = output;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1652 params.imageFormat = OrthancPluginImageFormat_Png;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1653 params.pixelFormat = format;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1654 params.width = width;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1655 params.height = height;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1656 params.pitch = pitch;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1657 params.buffer = buffer;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1658 params.quality = 0; /* No quality for PNG */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1659 context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1660 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1661
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1662
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1663
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1664 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1665 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1666 OrthancPluginMemoryBuffer* target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1667 const char* instanceId;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1668 } _OrthancPluginGetDicomForInstance;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1669
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1670 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1671 * @brief Retrieve a DICOM instance using its Orthanc identifier.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1672 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1673 * Retrieve a DICOM instance using its Orthanc identifier. The DICOM
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1674 * file is stored into a newly allocated memory buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1675 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1676 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1677 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1678 * @param instanceId The Orthanc identifier of the DICOM instance of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1679 * @return 0 if success, or the error code if failure.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1680 * @ingroup Orthanc
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1681 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1682 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginGetDicomForInstance(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1683 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1684 OrthancPluginMemoryBuffer* target,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1685 const char* instanceId)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1686 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1687 _OrthancPluginGetDicomForInstance params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1688 params.target = target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1689 params.instanceId = instanceId;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1690 return context->InvokeService(context, _OrthancPluginService_GetDicomForInstance, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1691 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1692
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1693
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1694
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1695 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1696 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1697 OrthancPluginMemoryBuffer* target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1698 const char* uri;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1699 } _OrthancPluginRestApiGet;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1700
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1701 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1702 * @brief Make a GET call to the built-in Orthanc REST API.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1703 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1704 * Make a GET call to the built-in Orthanc REST API. The result to
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1705 * the query is stored into a newly allocated memory buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1706 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1707 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1708 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1709 * @param uri The URI in the built-in Orthanc API.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1710 * @return 0 if success, or the error code if failure.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1711 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1712 * @see OrthancPluginRestApiGetAfterPlugins
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1713 * @ingroup Orthanc
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1714 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1715 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGet(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1716 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1717 OrthancPluginMemoryBuffer* target,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1718 const char* uri)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1719 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1720 _OrthancPluginRestApiGet params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1721 params.target = target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1722 params.uri = uri;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1723 return context->InvokeService(context, _OrthancPluginService_RestApiGet, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1724 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1725
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1726
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1727
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1728 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1729 * @brief Make a GET call to the REST API, as tainted by the plugins.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1730 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1731 * Make a GET call to the Orthanc REST API, after all the plugins
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1732 * are applied. In other words, if some plugin overrides or adds the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1733 * called URI to the built-in Orthanc REST API, this call will
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1734 * return the result provided by this plugin. The result to the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1735 * query is stored into a newly allocated memory buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1736 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1737 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1738 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1739 * @param uri The URI in the built-in Orthanc API.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1740 * @return 0 if success, or the error code if failure.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1741 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1742 * @see OrthancPluginRestApiGet
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1743 * @ingroup Orthanc
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1744 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1745 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGetAfterPlugins(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1746 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1747 OrthancPluginMemoryBuffer* target,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1748 const char* uri)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1749 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1750 _OrthancPluginRestApiGet params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1751 params.target = target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1752 params.uri = uri;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1753 return context->InvokeService(context, _OrthancPluginService_RestApiGetAfterPlugins, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1754 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1755
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1756
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1757
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1758 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1759 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1760 OrthancPluginMemoryBuffer* target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1761 const char* uri;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1762 const char* body;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1763 uint32_t bodySize;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1764 } _OrthancPluginRestApiPostPut;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1765
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1766 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1767 * @brief Make a POST call to the built-in Orthanc REST API.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1768 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1769 * Make a POST call to the built-in Orthanc REST API. The result to
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1770 * the query is stored into a newly allocated memory buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1771 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1772 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1773 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1774 * @param uri The URI in the built-in Orthanc API.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1775 * @param body The body of the POST request.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1776 * @param bodySize The size of the body.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1777 * @return 0 if success, or the error code if failure.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1778 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1779 * @see OrthancPluginRestApiPostAfterPlugins
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1780 * @ingroup Orthanc
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1781 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1782 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPost(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1783 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1784 OrthancPluginMemoryBuffer* target,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1785 const char* uri,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1786 const char* body,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1787 uint32_t bodySize)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1788 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1789 _OrthancPluginRestApiPostPut params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1790 params.target = target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1791 params.uri = uri;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1792 params.body = body;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1793 params.bodySize = bodySize;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1794 return context->InvokeService(context, _OrthancPluginService_RestApiPost, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1795 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1796
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1797
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1798 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1799 * @brief Make a POST call to the REST API, as tainted by the plugins.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1800 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1801 * Make a POST call to the Orthanc REST API, after all the plugins
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1802 * are applied. In other words, if some plugin overrides or adds the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1803 * called URI to the built-in Orthanc REST API, this call will
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1804 * return the result provided by this plugin. The result to the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1805 * query is stored into a newly allocated memory buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1806 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1807 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1808 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1809 * @param uri The URI in the built-in Orthanc API.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1810 * @param body The body of the POST request.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1811 * @param bodySize The size of the body.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1812 * @return 0 if success, or the error code if failure.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1813 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1814 * @see OrthancPluginRestApiPost
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1815 * @ingroup Orthanc
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1816 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1817 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPostAfterPlugins(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1818 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1819 OrthancPluginMemoryBuffer* target,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1820 const char* uri,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1821 const char* body,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1822 uint32_t bodySize)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1823 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1824 _OrthancPluginRestApiPostPut params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1825 params.target = target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1826 params.uri = uri;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1827 params.body = body;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1828 params.bodySize = bodySize;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1829 return context->InvokeService(context, _OrthancPluginService_RestApiPostAfterPlugins, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1830 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1831
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1832
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1833
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1834 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1835 * @brief Make a DELETE call to the built-in Orthanc REST API.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1836 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1837 * Make a DELETE call to the built-in Orthanc REST API.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1838 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1839 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1840 * @param uri The URI to delete in the built-in Orthanc API.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1841 * @return 0 if success, or the error code if failure.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1842 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1843 * @see OrthancPluginRestApiDeleteAfterPlugins
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1844 * @ingroup Orthanc
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1845 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1846 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiDelete(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1847 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1848 const char* uri)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1849 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1850 return context->InvokeService(context, _OrthancPluginService_RestApiDelete, uri);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1851 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1852
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1853
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1854 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1855 * @brief Make a DELETE call to the REST API, as tainted by the plugins.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1856 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1857 * Make a DELETE call to the Orthanc REST API, after all the plugins
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1858 * are applied. In other words, if some plugin overrides or adds the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1859 * called URI to the built-in Orthanc REST API, this call will
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1860 * return the result provided by this plugin.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1861 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1862 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1863 * @param uri The URI to delete in the built-in Orthanc API.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1864 * @return 0 if success, or the error code if failure.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1865 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1866 * @see OrthancPluginRestApiDelete
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1867 * @ingroup Orthanc
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1868 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1869 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiDeleteAfterPlugins(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1870 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1871 const char* uri)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1872 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1873 return context->InvokeService(context, _OrthancPluginService_RestApiDeleteAfterPlugins, uri);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1874 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1875
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1876
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1877
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1878 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1879 * @brief Make a PUT call to the built-in Orthanc REST API.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1880 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1881 * Make a PUT call to the built-in Orthanc REST API. The result to
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1882 * the query is stored into a newly allocated memory buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1883 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1884 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1885 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1886 * @param uri The URI in the built-in Orthanc API.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1887 * @param body The body of the PUT request.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1888 * @param bodySize The size of the body.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1889 * @return 0 if success, or the error code if failure.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1890 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1891 * @see OrthancPluginRestApiPutAfterPlugins
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1892 * @ingroup Orthanc
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1893 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1894 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPut(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1895 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1896 OrthancPluginMemoryBuffer* target,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1897 const char* uri,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1898 const char* body,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1899 uint32_t bodySize)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1900 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1901 _OrthancPluginRestApiPostPut params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1902 params.target = target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1903 params.uri = uri;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1904 params.body = body;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1905 params.bodySize = bodySize;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1906 return context->InvokeService(context, _OrthancPluginService_RestApiPut, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1907 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1908
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1909
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1910
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1911 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1912 * @brief Make a PUT call to the REST API, as tainted by the plugins.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1913 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1914 * Make a PUT call to the Orthanc REST API, after all the plugins
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1915 * are applied. In other words, if some plugin overrides or adds the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1916 * called URI to the built-in Orthanc REST API, this call will
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1917 * return the result provided by this plugin. The result to the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1918 * query is stored into a newly allocated memory buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1919 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1920 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1921 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1922 * @param uri The URI in the built-in Orthanc API.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1923 * @param body The body of the PUT request.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1924 * @param bodySize The size of the body.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1925 * @return 0 if success, or the error code if failure.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1926 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1927 * @see OrthancPluginRestApiPut
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1928 * @ingroup Orthanc
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1929 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1930 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPutAfterPlugins(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1931 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1932 OrthancPluginMemoryBuffer* target,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1933 const char* uri,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1934 const char* body,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1935 uint32_t bodySize)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1936 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1937 _OrthancPluginRestApiPostPut params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1938 params.target = target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1939 params.uri = uri;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1940 params.body = body;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1941 params.bodySize = bodySize;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1942 return context->InvokeService(context, _OrthancPluginService_RestApiPutAfterPlugins, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1943 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1944
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1945
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1946
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1947 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1948 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1949 OrthancPluginRestOutput* output;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1950 const char* argument;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1951 } _OrthancPluginOutputPlusArgument;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1952
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1953 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1954 * @brief Redirect a REST request.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1955 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1956 * This function answers to a REST request by redirecting the user
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1957 * to another URI using HTTP status 301.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1958 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1959 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1960 * @param output The HTTP connection to the client application.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1961 * @param redirection Where to redirect.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1962 * @ingroup REST
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1963 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1964 ORTHANC_PLUGIN_INLINE void OrthancPluginRedirect(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1965 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1966 OrthancPluginRestOutput* output,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1967 const char* redirection)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1968 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1969 _OrthancPluginOutputPlusArgument params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1970 params.output = output;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1971 params.argument = redirection;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1972 context->InvokeService(context, _OrthancPluginService_Redirect, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1973 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1974
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1975
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1976
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1977 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1978 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1979 char** result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1980 const char* argument;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1981 } _OrthancPluginRetrieveDynamicString;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1982
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1983 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1984 * @brief Look for a patient.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1985 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1986 * Look for a patient stored in Orthanc, using its Patient ID tag (0x0010, 0x0020).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1987 * This function uses the database index to run as fast as possible (it does not loop
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1988 * over all the stored patients).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1989 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1990 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1991 * @param patientID The Patient ID of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1992 * @return The NULL value if the patient is non-existent, or a string containing the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1993 * Orthanc ID of the patient. This string must be freed by OrthancPluginFreeString().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1994 * @ingroup Orthanc
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1995 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1996 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupPatient(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1997 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1998 const char* patientID)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1999 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2000 char* result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2001
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2002 _OrthancPluginRetrieveDynamicString params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2003 params.result = &result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2004 params.argument = patientID;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2005
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2006 if (context->InvokeService(context, _OrthancPluginService_LookupPatient, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2007 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2008 /* Error */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2009 return NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2010 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2011 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2012 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2013 return result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2014 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2015 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2016
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2017
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2018 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2019 * @brief Look for a study.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2020 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2021 * Look for a study stored in Orthanc, using its Study Instance UID tag (0x0020, 0x000d).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2022 * This function uses the database index to run as fast as possible (it does not loop
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2023 * over all the stored studies).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2024 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2025 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2026 * @param studyUID The Study Instance UID of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2027 * @return The NULL value if the study is non-existent, or a string containing the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2028 * Orthanc ID of the study. This string must be freed by OrthancPluginFreeString().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2029 * @ingroup Orthanc
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2030 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2031 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudy(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2032 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2033 const char* studyUID)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2034 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2035 char* result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2036
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2037 _OrthancPluginRetrieveDynamicString params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2038 params.result = &result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2039 params.argument = studyUID;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2040
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2041 if (context->InvokeService(context, _OrthancPluginService_LookupStudy, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2042 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2043 /* Error */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2044 return NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2045 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2046 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2047 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2048 return result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2049 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2050 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2051
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2052
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2053 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2054 * @brief Look for a study, using the accession number.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2055 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2056 * Look for a study stored in Orthanc, using its Accession Number tag (0x0008, 0x0050).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2057 * This function uses the database index to run as fast as possible (it does not loop
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2058 * over all the stored studies).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2059 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2060 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2061 * @param accessionNumber The Accession Number of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2062 * @return The NULL value if the study is non-existent, or a string containing the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2063 * Orthanc ID of the study. This string must be freed by OrthancPluginFreeString().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2064 * @ingroup Orthanc
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2065 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2066 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudyWithAccessionNumber(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2067 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2068 const char* accessionNumber)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2069 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2070 char* result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2071
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2072 _OrthancPluginRetrieveDynamicString params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2073 params.result = &result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2074 params.argument = accessionNumber;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2075
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2076 if (context->InvokeService(context, _OrthancPluginService_LookupStudyWithAccessionNumber, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2077 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2078 /* Error */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2079 return NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2080 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2081 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2082 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2083 return result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2084 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2085 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2086
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2087
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2088 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2089 * @brief Look for a series.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2090 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2091 * Look for a series stored in Orthanc, using its Series Instance UID tag (0x0020, 0x000e).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2092 * This function uses the database index to run as fast as possible (it does not loop
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2093 * over all the stored series).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2094 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2095 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2096 * @param seriesUID The Series Instance UID of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2097 * @return The NULL value if the series is non-existent, or a string containing the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2098 * Orthanc ID of the series. This string must be freed by OrthancPluginFreeString().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2099 * @ingroup Orthanc
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2100 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2101 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupSeries(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2102 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2103 const char* seriesUID)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2104 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2105 char* result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2106
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2107 _OrthancPluginRetrieveDynamicString params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2108 params.result = &result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2109 params.argument = seriesUID;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2110
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2111 if (context->InvokeService(context, _OrthancPluginService_LookupSeries, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2112 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2113 /* Error */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2114 return NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2115 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2116 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2117 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2118 return result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2119 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2120 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2121
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2122
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2123 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2124 * @brief Look for an instance.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2125 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2126 * Look for an instance stored in Orthanc, using its SOP Instance UID tag (0x0008, 0x0018).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2127 * This function uses the database index to run as fast as possible (it does not loop
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2128 * over all the stored instances).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2129 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2130 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2131 * @param sopInstanceUID The SOP Instance UID of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2132 * @return The NULL value if the instance is non-existent, or a string containing the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2133 * Orthanc ID of the instance. This string must be freed by OrthancPluginFreeString().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2134 * @ingroup Orthanc
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2135 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2136 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupInstance(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2137 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2138 const char* sopInstanceUID)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2139 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2140 char* result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2141
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2142 _OrthancPluginRetrieveDynamicString params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2143 params.result = &result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2144 params.argument = sopInstanceUID;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2145
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2146 if (context->InvokeService(context, _OrthancPluginService_LookupInstance, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2147 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2148 /* Error */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2149 return NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2150 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2151 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2152 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2153 return result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2154 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2155 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2156
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2157
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2158
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2159 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2160 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2161 OrthancPluginRestOutput* output;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2162 uint16_t status;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2163 } _OrthancPluginSendHttpStatusCode;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2164
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2165 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2166 * @brief Send a HTTP status code.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2167 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2168 * This function answers to a REST request by sending a HTTP status
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2169 * code (such as "400 - Bad Request"). Note that:
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2170 * - Successful requests (status 200) must use ::OrthancPluginAnswerBuffer().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2171 * - Redirections (status 301) must use ::OrthancPluginRedirect().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2172 * - Unauthorized access (status 401) must use ::OrthancPluginSendUnauthorized().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2173 * - Methods not allowed (status 405) must use ::OrthancPluginSendMethodNotAllowed().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2174 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2175 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2176 * @param output The HTTP connection to the client application.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2177 * @param status The HTTP status code to be sent.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2178 * @ingroup REST
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2179 * @see OrthancPluginSendHttpStatus()
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2180 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2181 ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatusCode(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2182 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2183 OrthancPluginRestOutput* output,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2184 uint16_t status)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2185 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2186 _OrthancPluginSendHttpStatusCode params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2187 params.output = output;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2188 params.status = status;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2189 context->InvokeService(context, _OrthancPluginService_SendHttpStatusCode, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2190 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2191
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2192
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2193 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2194 * @brief Signal that a REST request is not authorized.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2195 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2196 * This function answers to a REST request by signaling that it is
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2197 * not authorized.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2198 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2199 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2200 * @param output The HTTP connection to the client application.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2201 * @param realm The realm for the authorization process.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2202 * @ingroup REST
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2203 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2204 ORTHANC_PLUGIN_INLINE void OrthancPluginSendUnauthorized(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2205 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2206 OrthancPluginRestOutput* output,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2207 const char* realm)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2208 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2209 _OrthancPluginOutputPlusArgument params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2210 params.output = output;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2211 params.argument = realm;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2212 context->InvokeService(context, _OrthancPluginService_SendUnauthorized, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2213 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2214
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2215
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2216 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2217 * @brief Signal that this URI does not support this HTTP method.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2218 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2219 * This function answers to a REST request by signaling that the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2220 * queried URI does not support this method.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2221 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2222 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2223 * @param output The HTTP connection to the client application.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2224 * @param allowedMethods The allowed methods for this URI (e.g. "GET,POST" after a PUT or a POST request).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2225 * @ingroup REST
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2226 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2227 ORTHANC_PLUGIN_INLINE void OrthancPluginSendMethodNotAllowed(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2228 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2229 OrthancPluginRestOutput* output,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2230 const char* allowedMethods)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2231 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2232 _OrthancPluginOutputPlusArgument params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2233 params.output = output;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2234 params.argument = allowedMethods;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2235 context->InvokeService(context, _OrthancPluginService_SendMethodNotAllowed, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2236 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2237
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2238
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2239 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2240 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2241 OrthancPluginRestOutput* output;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2242 const char* key;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2243 const char* value;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2244 } _OrthancPluginSetHttpHeader;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2245
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2246 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2247 * @brief Set a cookie.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2248 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2249 * This function sets a cookie in the HTTP client.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2250 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2251 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2252 * @param output The HTTP connection to the client application.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2253 * @param cookie The cookie to be set.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2254 * @param value The value of the cookie.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2255 * @ingroup REST
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2256 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2257 ORTHANC_PLUGIN_INLINE void OrthancPluginSetCookie(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2258 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2259 OrthancPluginRestOutput* output,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2260 const char* cookie,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2261 const char* value)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2262 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2263 _OrthancPluginSetHttpHeader params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2264 params.output = output;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2265 params.key = cookie;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2266 params.value = value;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2267 context->InvokeService(context, _OrthancPluginService_SetCookie, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2268 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2269
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2270
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2271 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2272 * @brief Set some HTTP header.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2273 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2274 * This function sets a HTTP header in the HTTP answer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2275 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2276 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2277 * @param output The HTTP connection to the client application.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2278 * @param key The HTTP header to be set.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2279 * @param value The value of the HTTP header.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2280 * @ingroup REST
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2281 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2282 ORTHANC_PLUGIN_INLINE void OrthancPluginSetHttpHeader(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2283 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2284 OrthancPluginRestOutput* output,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2285 const char* key,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2286 const char* value)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2287 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2288 _OrthancPluginSetHttpHeader params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2289 params.output = output;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2290 params.key = key;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2291 params.value = value;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2292 context->InvokeService(context, _OrthancPluginService_SetHttpHeader, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2293 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2294
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2295
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2296 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2297 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2298 char** resultStringToFree;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2299 const char** resultString;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2300 int64_t* resultInt64;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2301 const char* key;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2302 OrthancPluginDicomInstance* instance;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2303 OrthancPluginInstanceOrigin* resultOrigin; /* New in Orthanc 0.9.5 SDK */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2304 } _OrthancPluginAccessDicomInstance;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2305
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2306
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2307 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2308 * @brief Get the AET of a DICOM instance.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2309 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2310 * This function returns the Application Entity Title (AET) of the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2311 * DICOM modality from which a DICOM instance originates.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2312 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2313 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2314 * @param instance The instance of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2315 * @return The AET if success, NULL if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2316 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2317 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2318 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceRemoteAet(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2319 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2320 OrthancPluginDicomInstance* instance)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2321 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2322 const char* result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2323
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2324 _OrthancPluginAccessDicomInstance params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2325 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2326 params.resultString = &result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2327 params.instance = instance;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2328
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2329 if (context->InvokeService(context, _OrthancPluginService_GetInstanceRemoteAet, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2330 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2331 /* Error */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2332 return NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2333 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2334 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2335 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2336 return result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2337 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2338 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2339
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2340
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2341 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2342 * @brief Get the size of a DICOM file.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2343 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2344 * This function returns the number of bytes of the given DICOM instance.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2345 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2346 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2347 * @param instance The instance of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2348 * @return The size of the file, -1 in case of error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2349 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2350 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2351 ORTHANC_PLUGIN_INLINE int64_t OrthancPluginGetInstanceSize(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2352 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2353 OrthancPluginDicomInstance* instance)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2354 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2355 int64_t size;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2356
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2357 _OrthancPluginAccessDicomInstance params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2358 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2359 params.resultInt64 = &size;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2360 params.instance = instance;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2361
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2362 if (context->InvokeService(context, _OrthancPluginService_GetInstanceSize, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2363 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2364 /* Error */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2365 return -1;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2366 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2367 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2368 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2369 return size;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2370 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2371 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2372
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2373
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2374 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2375 * @brief Get the data of a DICOM file.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2376 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2377 * This function returns a pointer to the content of the given DICOM instance.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2378 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2379 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2380 * @param instance The instance of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2381 * @return The pointer to the DICOM data, NULL in case of error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2382 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2383 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2384 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceData(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2385 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2386 OrthancPluginDicomInstance* instance)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2387 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2388 const char* result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2389
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2390 _OrthancPluginAccessDicomInstance params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2391 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2392 params.resultString = &result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2393 params.instance = instance;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2394
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2395 if (context->InvokeService(context, _OrthancPluginService_GetInstanceData, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2396 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2397 /* Error */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2398 return NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2399 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2400 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2401 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2402 return result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2403 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2404 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2405
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2406
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2407 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2408 * @brief Get the DICOM tag hierarchy as a JSON file.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2409 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2410 * This function returns a pointer to a newly created string
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2411 * containing a JSON file. This JSON file encodes the tag hierarchy
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2412 * of the given DICOM instance.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2413 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2414 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2415 * @param instance The instance of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2416 * @return The NULL value in case of error, or a string containing the JSON file.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2417 * This string must be freed by OrthancPluginFreeString().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2418 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2419 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2420 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceJson(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2421 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2422 OrthancPluginDicomInstance* instance)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2423 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2424 char* result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2425
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2426 _OrthancPluginAccessDicomInstance params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2427 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2428 params.resultStringToFree = &result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2429 params.instance = instance;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2430
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2431 if (context->InvokeService(context, _OrthancPluginService_GetInstanceJson, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2432 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2433 /* Error */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2434 return NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2435 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2436 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2437 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2438 return result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2439 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2440 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2441
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2442
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2443 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2444 * @brief Get the DICOM tag hierarchy as a JSON file (with simplification).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2445 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2446 * This function returns a pointer to a newly created string
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2447 * containing a JSON file. This JSON file encodes the tag hierarchy
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2448 * of the given DICOM instance. In contrast with
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2449 * ::OrthancPluginGetInstanceJson(), the returned JSON file is in
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2450 * its simplified version.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2451 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2452 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2453 * @param instance The instance of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2454 * @return The NULL value in case of error, or a string containing the JSON file.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2455 * This string must be freed by OrthancPluginFreeString().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2456 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2457 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2458 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceSimplifiedJson(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2459 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2460 OrthancPluginDicomInstance* instance)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2461 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2462 char* result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2463
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2464 _OrthancPluginAccessDicomInstance params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2465 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2466 params.resultStringToFree = &result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2467 params.instance = instance;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2468
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2469 if (context->InvokeService(context, _OrthancPluginService_GetInstanceSimplifiedJson, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2470 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2471 /* Error */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2472 return NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2473 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2474 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2475 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2476 return result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2477 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2478 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2479
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2480
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2481 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2482 * @brief Check whether a DICOM instance is associated with some metadata.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2483 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2484 * This function checks whether the DICOM instance of interest is
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2485 * associated with some metadata. As of Orthanc 0.8.1, in the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2486 * callbacks registered by
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2487 * ::OrthancPluginRegisterOnStoredInstanceCallback(), the only
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2488 * possibly available metadata are "ReceptionDate", "RemoteAET" and
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2489 * "IndexInSeries".
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2490 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2491 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2492 * @param instance The instance of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2493 * @param metadata The metadata of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2494 * @return 1 if the metadata is present, 0 if it is absent, -1 in case of error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2495 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2496 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2497 ORTHANC_PLUGIN_INLINE int OrthancPluginHasInstanceMetadata(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2498 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2499 OrthancPluginDicomInstance* instance,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2500 const char* metadata)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2501 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2502 int64_t result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2503
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2504 _OrthancPluginAccessDicomInstance params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2505 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2506 params.resultInt64 = &result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2507 params.instance = instance;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2508 params.key = metadata;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2509
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2510 if (context->InvokeService(context, _OrthancPluginService_HasInstanceMetadata, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2511 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2512 /* Error */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2513 return -1;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2514 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2515 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2516 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2517 return (result != 0);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2518 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2519 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2520
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2521
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2522 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2523 * @brief Get the value of some metadata associated with a given DICOM instance.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2524 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2525 * This functions returns the value of some metadata that is associated with the DICOM instance of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2526 * Before calling this function, the existence of the metadata must have been checked with
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2527 * ::OrthancPluginHasInstanceMetadata().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2528 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2529 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2530 * @param instance The instance of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2531 * @param metadata The metadata of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2532 * @return The metadata value if success, NULL if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2533 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2534 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2535 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceMetadata(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2536 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2537 OrthancPluginDicomInstance* instance,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2538 const char* metadata)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2539 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2540 const char* result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2541
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2542 _OrthancPluginAccessDicomInstance params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2543 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2544 params.resultString = &result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2545 params.instance = instance;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2546 params.key = metadata;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2547
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2548 if (context->InvokeService(context, _OrthancPluginService_GetInstanceMetadata, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2549 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2550 /* Error */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2551 return NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2552 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2553 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2554 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2555 return result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2556 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2557 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2558
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2559
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2560
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2561 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2562 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2563 OrthancPluginStorageCreate create;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2564 OrthancPluginStorageRead read;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2565 OrthancPluginStorageRemove remove;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2566 OrthancPluginFree free;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2567 } _OrthancPluginRegisterStorageArea;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2568
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2569 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2570 * @brief Register a custom storage area.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2571 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2572 * This function registers a custom storage area, to replace the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2573 * built-in way Orthanc stores its files on the filesystem. This
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2574 * function must be called during the initialization of the plugin,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2575 * i.e. inside the OrthancPluginInitialize() public function.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2576 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2577 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2578 * @param create The callback function to store a file on the custom storage area.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2579 * @param read The callback function to read a file from the custom storage area.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2580 * @param remove The callback function to remove a file from the custom storage area.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2581 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2582 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2583 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterStorageArea(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2584 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2585 OrthancPluginStorageCreate create,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2586 OrthancPluginStorageRead read,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2587 OrthancPluginStorageRemove remove)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2588 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2589 _OrthancPluginRegisterStorageArea params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2590 params.create = create;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2591 params.read = read;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2592 params.remove = remove;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2593
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2594 #ifdef __cplusplus
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2595 params.free = ::free;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2596 #else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2597 params.free = free;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2598 #endif
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2599
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2600 context->InvokeService(context, _OrthancPluginService_RegisterStorageArea, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2601 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2602
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2603
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2604
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2605 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2606 * @brief Return the path to the Orthanc executable.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2607 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2608 * This function returns the path to the Orthanc executable.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2609 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2610 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2611 * @return NULL in the case of an error, or a newly allocated string
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2612 * containing the path. This string must be freed by
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2613 * OrthancPluginFreeString().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2614 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2615 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancPath(OrthancPluginContext* context)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2616 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2617 char* result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2618
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2619 _OrthancPluginRetrieveDynamicString params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2620 params.result = &result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2621 params.argument = NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2622
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2623 if (context->InvokeService(context, _OrthancPluginService_GetOrthancPath, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2624 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2625 /* Error */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2626 return NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2627 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2628 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2629 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2630 return result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2631 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2632 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2633
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2634
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2635 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2636 * @brief Return the directory containing the Orthanc.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2637 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2638 * This function returns the path to the directory containing the Orthanc executable.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2639 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2640 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2641 * @return NULL in the case of an error, or a newly allocated string
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2642 * containing the path. This string must be freed by
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2643 * OrthancPluginFreeString().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2644 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2645 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancDirectory(OrthancPluginContext* context)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2646 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2647 char* result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2648
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2649 _OrthancPluginRetrieveDynamicString params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2650 params.result = &result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2651 params.argument = NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2652
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2653 if (context->InvokeService(context, _OrthancPluginService_GetOrthancDirectory, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2654 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2655 /* Error */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2656 return NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2657 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2658 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2659 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2660 return result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2661 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2662 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2663
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2664
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2665 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2666 * @brief Return the path to the configuration file(s).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2667 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2668 * This function returns the path to the configuration file(s) that
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2669 * was specified when starting Orthanc. Since version 0.9.1, this
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2670 * path can refer to a folder that stores a set of configuration
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2671 * files. This function is deprecated in favor of
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2672 * OrthancPluginGetConfiguration().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2673 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2674 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2675 * @return NULL in the case of an error, or a newly allocated string
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2676 * containing the path. This string must be freed by
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2677 * OrthancPluginFreeString().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2678 * @see OrthancPluginGetConfiguration()
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2679 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2680 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfigurationPath(OrthancPluginContext* context)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2681 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2682 char* result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2683
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2684 _OrthancPluginRetrieveDynamicString params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2685 params.result = &result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2686 params.argument = NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2687
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2688 if (context->InvokeService(context, _OrthancPluginService_GetConfigurationPath, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2689 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2690 /* Error */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2691 return NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2692 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2693 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2694 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2695 return result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2696 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2697 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2698
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2699
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2700
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2701 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2702 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2703 OrthancPluginOnChangeCallback callback;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2704 } _OrthancPluginOnChangeCallback;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2705
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2706 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2707 * @brief Register a callback to monitor changes.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2708 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2709 * This function registers a callback function that is called
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2710 * whenever a change happens to some DICOM resource.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2711 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2712 * @warning If your change callback has to call the REST API of
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2713 * Orthanc, you should make these calls in a separate thread (with
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2714 * the events passing through a message queue). Otherwise, this
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2715 * could result in deadlocks in the presence of other plugins or Lua
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2716 * scripts.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2717 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2718 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2719 * @param callback The callback function.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2720 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2721 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2722 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnChangeCallback(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2723 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2724 OrthancPluginOnChangeCallback callback)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2725 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2726 _OrthancPluginOnChangeCallback params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2727 params.callback = callback;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2728
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2729 context->InvokeService(context, _OrthancPluginService_RegisterOnChangeCallback, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2730 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2731
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2732
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2733
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2734 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2735 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2736 const char* plugin;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2737 _OrthancPluginProperty property;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2738 const char* value;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2739 } _OrthancPluginSetPluginProperty;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2740
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2741
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2742 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2743 * @brief Set the URI where the plugin provides its Web interface.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2744 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2745 * For plugins that come with a Web interface, this function
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2746 * declares the entry path where to find this interface. This
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2747 * information is notably used in the "Plugins" page of Orthanc
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2748 * Explorer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2749 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2750 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2751 * @param uri The root URI for this plugin.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2752 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2753 ORTHANC_PLUGIN_INLINE void OrthancPluginSetRootUri(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2754 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2755 const char* uri)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2756 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2757 _OrthancPluginSetPluginProperty params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2758 params.plugin = OrthancPluginGetName();
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2759 params.property = _OrthancPluginProperty_RootUri;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2760 params.value = uri;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2761
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2762 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2763 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2764
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2765
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2766 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2767 * @brief Set a description for this plugin.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2768 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2769 * Set a description for this plugin. It is displayed in the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2770 * "Plugins" page of Orthanc Explorer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2771 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2772 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2773 * @param description The description.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2774 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2775 ORTHANC_PLUGIN_INLINE void OrthancPluginSetDescription(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2776 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2777 const char* description)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2778 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2779 _OrthancPluginSetPluginProperty params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2780 params.plugin = OrthancPluginGetName();
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2781 params.property = _OrthancPluginProperty_Description;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2782 params.value = description;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2783
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2784 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2785 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2786
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2787
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2788 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2789 * @brief Extend the JavaScript code of Orthanc Explorer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2790 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2791 * Add JavaScript code to customize the default behavior of Orthanc
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2792 * Explorer. This can for instance be used to add new buttons.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2793 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2794 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2795 * @param javascript The custom JavaScript code.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2796 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2797 ORTHANC_PLUGIN_INLINE void OrthancPluginExtendOrthancExplorer(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2798 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2799 const char* javascript)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2800 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2801 _OrthancPluginSetPluginProperty params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2802 params.plugin = OrthancPluginGetName();
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2803 params.property = _OrthancPluginProperty_OrthancExplorer;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2804 params.value = javascript;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2805
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2806 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2807 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2808
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2809
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2810 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2811 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2812 char** result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2813 int32_t property;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2814 const char* value;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2815 } _OrthancPluginGlobalProperty;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2816
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2817
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2818 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2819 * @brief Get the value of a global property.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2820 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2821 * Get the value of a global property that is stored in the Orthanc database. Global
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2822 * properties whose index is below 1024 are reserved by Orthanc.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2823 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2824 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2825 * @param property The global property of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2826 * @param defaultValue The value to return, if the global property is unset.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2827 * @return The value of the global property, or NULL in the case of an error. This
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2828 * string must be freed by OrthancPluginFreeString().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2829 * @ingroup Orthanc
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2830 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2831 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetGlobalProperty(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2832 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2833 int32_t property,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2834 const char* defaultValue)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2835 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2836 char* result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2837
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2838 _OrthancPluginGlobalProperty params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2839 params.result = &result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2840 params.property = property;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2841 params.value = defaultValue;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2842
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2843 if (context->InvokeService(context, _OrthancPluginService_GetGlobalProperty, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2844 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2845 /* Error */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2846 return NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2847 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2848 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2849 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2850 return result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2851 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2852 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2853
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2854
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2855 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2856 * @brief Set the value of a global property.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2857 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2858 * Set the value of a global property into the Orthanc
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2859 * database. Setting a global property can be used by plugins to
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2860 * save their internal parameters. Plugins are only allowed to set
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2861 * properties whose index are above or equal to 1024 (properties
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2862 * below 1024 are read-only and reserved by Orthanc).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2863 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2864 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2865 * @param property The global property of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2866 * @param value The value to be set in the global property.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2867 * @return 0 if success, or the error code if failure.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2868 * @ingroup Orthanc
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2869 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2870 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSetGlobalProperty(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2871 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2872 int32_t property,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2873 const char* value)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2874 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2875 _OrthancPluginGlobalProperty params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2876 params.result = NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2877 params.property = property;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2878 params.value = value;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2879
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2880 return context->InvokeService(context, _OrthancPluginService_SetGlobalProperty, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2881 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2882
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2883
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2884
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2885 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2886 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2887 int32_t *resultInt32;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2888 uint32_t *resultUint32;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2889 int64_t *resultInt64;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2890 uint64_t *resultUint64;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2891 } _OrthancPluginReturnSingleValue;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2892
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2893 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2894 * @brief Get the number of command-line arguments.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2895 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2896 * Retrieve the number of command-line arguments that were used to launch Orthanc.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2897 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2898 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2899 * @return The number of arguments.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2900 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2901 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetCommandLineArgumentsCount(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2902 OrthancPluginContext* context)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2903 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2904 uint32_t count = 0;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2905
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2906 _OrthancPluginReturnSingleValue params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2907 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2908 params.resultUint32 = &count;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2909
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2910 if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgumentsCount, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2911 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2912 /* Error */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2913 return 0;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2914 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2915 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2916 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2917 return count;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2918 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2919 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2920
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2921
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2922
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2923 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2924 * @brief Get the value of a command-line argument.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2925 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2926 * Get the value of one of the command-line arguments that were used
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2927 * to launch Orthanc. The number of available arguments can be
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2928 * retrieved by OrthancPluginGetCommandLineArgumentsCount().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2929 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2930 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2931 * @param argument The index of the argument.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2932 * @return The value of the argument, or NULL in the case of an error. This
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2933 * string must be freed by OrthancPluginFreeString().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2934 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2935 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetCommandLineArgument(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2936 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2937 uint32_t argument)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2938 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2939 char* result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2940
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2941 _OrthancPluginGlobalProperty params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2942 params.result = &result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2943 params.property = (int32_t) argument;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2944 params.value = NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2945
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2946 if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgument, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2947 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2948 /* Error */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2949 return NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2950 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2951 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2952 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2953 return result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2954 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2955 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2956
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2957
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2958 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2959 * @brief Get the expected version of the database schema.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2960 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2961 * Retrieve the expected version of the database schema.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2962 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2963 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2964 * @return The version.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2965 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2966 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2967 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetExpectedDatabaseVersion(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2968 OrthancPluginContext* context)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2969 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2970 uint32_t count = 0;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2971
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2972 _OrthancPluginReturnSingleValue params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2973 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2974 params.resultUint32 = &count;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2975
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2976 if (context->InvokeService(context, _OrthancPluginService_GetExpectedDatabaseVersion, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2977 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2978 /* Error */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2979 return 0;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2980 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2981 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2982 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2983 return count;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2984 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2985 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2986
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2987
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2988
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2989 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2990 * @brief Return the content of the configuration file(s).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2991 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2992 * This function returns the content of the configuration that is
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2993 * used by Orthanc, formatted as a JSON string.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2994 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2995 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2996 * @return NULL in the case of an error, or a newly allocated string
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2997 * containing the configuration. This string must be freed by
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2998 * OrthancPluginFreeString().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2999 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3000 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfiguration(OrthancPluginContext* context)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3001 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3002 char* result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3003
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3004 _OrthancPluginRetrieveDynamicString params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3005 params.result = &result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3006 params.argument = NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3007
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3008 if (context->InvokeService(context, _OrthancPluginService_GetConfiguration, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3009 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3010 /* Error */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3011 return NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3012 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3013 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3014 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3015 return result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3016 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3017 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3018
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3019
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3020
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3021 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3022 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3023 OrthancPluginRestOutput* output;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3024 const char* subType;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3025 const char* contentType;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3026 } _OrthancPluginStartMultipartAnswer;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3027
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3028 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3029 * @brief Start an HTTP multipart answer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3030 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3031 * Initiates a HTTP multipart answer, as the result of a REST request.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3032 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3033 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3034 * @param output The HTTP connection to the client application.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3035 * @param subType The sub-type of the multipart answer ("mixed" or "related").
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3036 * @param contentType The MIME type of the items in the multipart answer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3037 * @return 0 if success, or the error code if failure.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3038 * @see OrthancPluginSendMultipartItem(), OrthancPluginSendMultipartItem2()
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3039 * @ingroup REST
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3040 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3041 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStartMultipartAnswer(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3042 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3043 OrthancPluginRestOutput* output,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3044 const char* subType,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3045 const char* contentType)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3046 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3047 _OrthancPluginStartMultipartAnswer params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3048 params.output = output;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3049 params.subType = subType;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3050 params.contentType = contentType;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3051 return context->InvokeService(context, _OrthancPluginService_StartMultipartAnswer, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3052 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3053
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3054
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3055 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3056 * @brief Send an item as a part of some HTTP multipart answer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3057 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3058 * This function sends an item as a part of some HTTP multipart
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3059 * answer that was initiated by OrthancPluginStartMultipartAnswer().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3060 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3061 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3062 * @param output The HTTP connection to the client application.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3063 * @param answer Pointer to the memory buffer containing the item.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3064 * @param answerSize Number of bytes of the item.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3065 * @return 0 if success, or the error code if failure (this notably happens
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3066 * if the connection is closed by the client).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3067 * @see OrthancPluginSendMultipartItem2()
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3068 * @ingroup REST
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3069 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3070 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSendMultipartItem(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3071 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3072 OrthancPluginRestOutput* output,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3073 const char* answer,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3074 uint32_t answerSize)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3075 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3076 _OrthancPluginAnswerBuffer params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3077 params.output = output;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3078 params.answer = answer;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3079 params.answerSize = answerSize;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3080 params.mimeType = NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3081 return context->InvokeService(context, _OrthancPluginService_SendMultipartItem, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3082 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3083
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3084
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3085
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3086 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3087 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3088 OrthancPluginMemoryBuffer* target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3089 const void* source;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3090 uint32_t size;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3091 OrthancPluginCompressionType compression;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3092 uint8_t uncompress;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3093 } _OrthancPluginBufferCompression;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3094
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3095
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3096 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3097 * @brief Compress or decompress a buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3098 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3099 * This function compresses or decompresses a buffer, using the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3100 * version of the zlib library that is used by the Orthanc core.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3101 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3102 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3103 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3104 * @param source The source buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3105 * @param size The size in bytes of the source buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3106 * @param compression The compression algorithm.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3107 * @param uncompress If set to "0", the buffer must be compressed.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3108 * If set to "1", the buffer must be uncompressed.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3109 * @return 0 if success, or the error code if failure.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3110 * @ingroup Images
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3111 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3112 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginBufferCompression(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3113 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3114 OrthancPluginMemoryBuffer* target,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3115 const void* source,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3116 uint32_t size,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3117 OrthancPluginCompressionType compression,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3118 uint8_t uncompress)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3119 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3120 _OrthancPluginBufferCompression params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3121 params.target = target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3122 params.source = source;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3123 params.size = size;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3124 params.compression = compression;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3125 params.uncompress = uncompress;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3126
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3127 return context->InvokeService(context, _OrthancPluginService_BufferCompression, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3128 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3129
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3130
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3131
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3132 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3133 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3134 OrthancPluginMemoryBuffer* target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3135 const char* path;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3136 } _OrthancPluginReadFile;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3137
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3138 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3139 * @brief Read a file.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3140 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3141 * Read the content of a file on the filesystem, and returns it into
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3142 * a newly allocated memory buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3143 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3144 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3145 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3146 * @param path The path of the file to be read.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3147 * @return 0 if success, or the error code if failure.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3148 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3149 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginReadFile(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3150 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3151 OrthancPluginMemoryBuffer* target,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3152 const char* path)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3153 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3154 _OrthancPluginReadFile params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3155 params.target = target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3156 params.path = path;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3157 return context->InvokeService(context, _OrthancPluginService_ReadFile, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3158 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3159
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3160
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3161
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3162 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3163 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3164 const char* path;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3165 const void* data;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3166 uint32_t size;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3167 } _OrthancPluginWriteFile;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3168
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3169 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3170 * @brief Write a file.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3171 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3172 * Write the content of a memory buffer to the filesystem.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3173 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3174 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3175 * @param path The path of the file to be written.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3176 * @param data The content of the memory buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3177 * @param size The size of the memory buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3178 * @return 0 if success, or the error code if failure.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3179 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3180 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWriteFile(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3181 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3182 const char* path,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3183 const void* data,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3184 uint32_t size)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3185 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3186 _OrthancPluginWriteFile params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3187 params.path = path;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3188 params.data = data;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3189 params.size = size;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3190 return context->InvokeService(context, _OrthancPluginService_WriteFile, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3191 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3192
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3193
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3194
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3195 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3196 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3197 const char** target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3198 OrthancPluginErrorCode error;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3199 } _OrthancPluginGetErrorDescription;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3200
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3201 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3202 * @brief Get the description of a given error code.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3203 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3204 * This function returns the description of a given error code.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3205 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3206 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3207 * @param error The error code of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3208 * @return The error description. This is a statically-allocated
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3209 * string, do not free it.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3210 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3211 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetErrorDescription(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3212 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3213 OrthancPluginErrorCode error)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3214 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3215 const char* result = NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3216
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3217 _OrthancPluginGetErrorDescription params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3218 params.target = &result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3219 params.error = error;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3220
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3221 if (context->InvokeService(context, _OrthancPluginService_GetErrorDescription, &params) != OrthancPluginErrorCode_Success ||
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3222 result == NULL)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3223 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3224 return "Unknown error code";
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3225 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3226 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3227 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3228 return result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3229 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3230 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3231
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3232
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3233
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3234 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3235 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3236 OrthancPluginRestOutput* output;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3237 uint16_t status;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3238 const char* body;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3239 uint32_t bodySize;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3240 } _OrthancPluginSendHttpStatus;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3241
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3242 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3243 * @brief Send a HTTP status, with a custom body.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3244 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3245 * This function answers to a HTTP request by sending a HTTP status
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3246 * code (such as "400 - Bad Request"), together with a body
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3247 * describing the error. The body will only be returned if the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3248 * configuration option "HttpDescribeErrors" of Orthanc is set to "true".
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3249 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3250 * Note that:
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3251 * - Successful requests (status 200) must use ::OrthancPluginAnswerBuffer().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3252 * - Redirections (status 301) must use ::OrthancPluginRedirect().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3253 * - Unauthorized access (status 401) must use ::OrthancPluginSendUnauthorized().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3254 * - Methods not allowed (status 405) must use ::OrthancPluginSendMethodNotAllowed().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3255 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3256 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3257 * @param output The HTTP connection to the client application.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3258 * @param status The HTTP status code to be sent.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3259 * @param body The body of the answer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3260 * @param bodySize The size of the body.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3261 * @see OrthancPluginSendHttpStatusCode()
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3262 * @ingroup REST
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3263 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3264 ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatus(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3265 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3266 OrthancPluginRestOutput* output,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3267 uint16_t status,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3268 const char* body,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3269 uint32_t bodySize)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3270 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3271 _OrthancPluginSendHttpStatus params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3272 params.output = output;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3273 params.status = status;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3274 params.body = body;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3275 params.bodySize = bodySize;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3276 context->InvokeService(context, _OrthancPluginService_SendHttpStatus, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3277 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3278
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3279
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3280
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3281 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3282 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3283 const OrthancPluginImage* image;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3284 uint32_t* resultUint32;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3285 OrthancPluginPixelFormat* resultPixelFormat;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3286 void** resultBuffer;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3287 } _OrthancPluginGetImageInfo;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3288
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3289
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3290 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3291 * @brief Return the pixel format of an image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3292 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3293 * This function returns the type of memory layout for the pixels of the given image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3294 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3295 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3296 * @param image The image of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3297 * @return The pixel format.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3298 * @ingroup Images
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3299 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3300 ORTHANC_PLUGIN_INLINE OrthancPluginPixelFormat OrthancPluginGetImagePixelFormat(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3301 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3302 const OrthancPluginImage* image)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3303 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3304 OrthancPluginPixelFormat target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3305
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3306 _OrthancPluginGetImageInfo params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3307 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3308 params.image = image;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3309 params.resultPixelFormat = &target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3310
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3311 if (context->InvokeService(context, _OrthancPluginService_GetImagePixelFormat, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3312 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3313 return OrthancPluginPixelFormat_Unknown;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3314 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3315 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3316 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3317 return (OrthancPluginPixelFormat) target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3318 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3319 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3320
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3321
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3322
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3323 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3324 * @brief Return the width of an image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3325 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3326 * This function returns the width of the given image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3327 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3328 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3329 * @param image The image of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3330 * @return The width.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3331 * @ingroup Images
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3332 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3333 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageWidth(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3334 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3335 const OrthancPluginImage* image)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3336 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3337 uint32_t width;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3338
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3339 _OrthancPluginGetImageInfo params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3340 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3341 params.image = image;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3342 params.resultUint32 = &width;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3343
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3344 if (context->InvokeService(context, _OrthancPluginService_GetImageWidth, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3345 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3346 return 0;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3347 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3348 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3349 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3350 return width;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3351 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3352 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3353
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3354
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3355
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3356 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3357 * @brief Return the height of an image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3358 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3359 * This function returns the height of the given image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3360 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3361 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3362 * @param image The image of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3363 * @return The height.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3364 * @ingroup Images
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3365 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3366 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageHeight(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3367 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3368 const OrthancPluginImage* image)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3369 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3370 uint32_t height;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3371
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3372 _OrthancPluginGetImageInfo params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3373 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3374 params.image = image;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3375 params.resultUint32 = &height;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3376
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3377 if (context->InvokeService(context, _OrthancPluginService_GetImageHeight, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3378 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3379 return 0;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3380 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3381 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3382 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3383 return height;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3384 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3385 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3386
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3387
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3388
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3389 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3390 * @brief Return the pitch of an image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3391 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3392 * This function returns the pitch of the given image. The pitch is
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3393 * defined as the number of bytes between 2 successive lines of the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3394 * image in the memory buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3395 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3396 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3397 * @param image The image of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3398 * @return The pitch.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3399 * @ingroup Images
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3400 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3401 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImagePitch(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3402 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3403 const OrthancPluginImage* image)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3404 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3405 uint32_t pitch;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3406
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3407 _OrthancPluginGetImageInfo params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3408 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3409 params.image = image;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3410 params.resultUint32 = &pitch;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3411
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3412 if (context->InvokeService(context, _OrthancPluginService_GetImagePitch, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3413 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3414 return 0;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3415 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3416 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3417 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3418 return pitch;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3419 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3420 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3421
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3422
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3423
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3424 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3425 * @brief Return a pointer to the content of an image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3426 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3427 * This function returns a pointer to the memory buffer that
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3428 * contains the pixels of the image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3429 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3430 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3431 * @param image The image of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3432 * @return The pointer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3433 * @ingroup Images
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3434 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3435 ORTHANC_PLUGIN_INLINE void* OrthancPluginGetImageBuffer(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3436 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3437 const OrthancPluginImage* image)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3438 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3439 void* target = NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3440
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3441 _OrthancPluginGetImageInfo params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3442 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3443 params.resultBuffer = &target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3444 params.image = image;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3445
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3446 if (context->InvokeService(context, _OrthancPluginService_GetImageBuffer, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3447 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3448 return NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3449 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3450 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3451 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3452 return target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3453 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3454 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3455
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3456
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3457 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3458 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3459 OrthancPluginImage** target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3460 const void* data;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3461 uint32_t size;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3462 OrthancPluginImageFormat format;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3463 } _OrthancPluginUncompressImage;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3464
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3465
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3466 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3467 * @brief Decode a compressed image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3468 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3469 * This function decodes a compressed image from a memory buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3470 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3471 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3472 * @param data Pointer to a memory buffer containing the compressed image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3473 * @param size Size of the memory buffer containing the compressed image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3474 * @param format The file format of the compressed image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3475 * @return The uncompressed image. It must be freed with OrthancPluginFreeImage().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3476 * @ingroup Images
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3477 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3478 ORTHANC_PLUGIN_INLINE OrthancPluginImage *OrthancPluginUncompressImage(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3479 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3480 const void* data,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3481 uint32_t size,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3482 OrthancPluginImageFormat format)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3483 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3484 OrthancPluginImage* target = NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3485
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3486 _OrthancPluginUncompressImage params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3487 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3488 params.target = &target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3489 params.data = data;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3490 params.size = size;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3491 params.format = format;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3492
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3493 if (context->InvokeService(context, _OrthancPluginService_UncompressImage, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3494 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3495 return NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3496 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3497 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3498 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3499 return target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3500 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3501 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3502
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3503
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3504
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3505
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3506 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3507 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3508 OrthancPluginImage* image;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3509 } _OrthancPluginFreeImage;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3510
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3511 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3512 * @brief Free an image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3513 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3514 * This function frees an image that was decoded with OrthancPluginUncompressImage().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3515 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3516 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3517 * @param image The image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3518 * @ingroup Images
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3519 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3520 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeImage(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3521 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3522 OrthancPluginImage* image)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3523 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3524 _OrthancPluginFreeImage params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3525 params.image = image;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3526
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3527 context->InvokeService(context, _OrthancPluginService_FreeImage, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3528 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3529
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3530
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3531
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3532
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3533 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3534 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3535 OrthancPluginMemoryBuffer* target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3536 OrthancPluginImageFormat imageFormat;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3537 OrthancPluginPixelFormat pixelFormat;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3538 uint32_t width;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3539 uint32_t height;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3540 uint32_t pitch;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3541 const void* buffer;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3542 uint8_t quality;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3543 } _OrthancPluginCompressImage;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3544
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3545
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3546 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3547 * @brief Encode a PNG image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3548 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3549 * This function compresses the given memory buffer containing an
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3550 * image using the PNG specification, and stores the result of the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3551 * compression into a newly allocated memory buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3552 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3553 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3554 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3555 * @param format The memory layout of the uncompressed image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3556 * @param width The width of the image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3557 * @param height The height of the image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3558 * @param pitch The pitch of the image (i.e. the number of bytes
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3559 * between 2 successive lines of the image in the memory buffer).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3560 * @param buffer The memory buffer containing the uncompressed image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3561 * @return 0 if success, or the error code if failure.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3562 * @see OrthancPluginCompressAndAnswerPngImage()
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3563 * @ingroup Images
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3564 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3565 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCompressPngImage(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3566 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3567 OrthancPluginMemoryBuffer* target,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3568 OrthancPluginPixelFormat format,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3569 uint32_t width,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3570 uint32_t height,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3571 uint32_t pitch,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3572 const void* buffer)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3573 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3574 _OrthancPluginCompressImage params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3575 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3576 params.target = target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3577 params.imageFormat = OrthancPluginImageFormat_Png;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3578 params.pixelFormat = format;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3579 params.width = width;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3580 params.height = height;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3581 params.pitch = pitch;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3582 params.buffer = buffer;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3583 params.quality = 0; /* Unused for PNG */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3584
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3585 return context->InvokeService(context, _OrthancPluginService_CompressImage, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3586 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3587
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3588
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3589 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3590 * @brief Encode a JPEG image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3591 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3592 * This function compresses the given memory buffer containing an
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3593 * image using the JPEG specification, and stores the result of the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3594 * compression into a newly allocated memory buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3595 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3596 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3597 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3598 * @param format The memory layout of the uncompressed image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3599 * @param width The width of the image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3600 * @param height The height of the image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3601 * @param pitch The pitch of the image (i.e. the number of bytes
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3602 * between 2 successive lines of the image in the memory buffer).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3603 * @param buffer The memory buffer containing the uncompressed image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3604 * @param quality The quality of the JPEG encoding, between 1 (worst
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3605 * quality, best compression) and 100 (best quality, worst
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3606 * compression).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3607 * @return 0 if success, or the error code if failure.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3608 * @ingroup Images
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3609 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3610 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCompressJpegImage(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3611 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3612 OrthancPluginMemoryBuffer* target,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3613 OrthancPluginPixelFormat format,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3614 uint32_t width,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3615 uint32_t height,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3616 uint32_t pitch,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3617 const void* buffer,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3618 uint8_t quality)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3619 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3620 _OrthancPluginCompressImage params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3621 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3622 params.target = target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3623 params.imageFormat = OrthancPluginImageFormat_Jpeg;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3624 params.pixelFormat = format;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3625 params.width = width;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3626 params.height = height;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3627 params.pitch = pitch;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3628 params.buffer = buffer;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3629 params.quality = quality;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3630
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3631 return context->InvokeService(context, _OrthancPluginService_CompressImage, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3632 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3633
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3634
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3635
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3636 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3637 * @brief Answer to a REST request with a JPEG image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3638 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3639 * This function answers to a REST request with a JPEG image. The
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3640 * parameters of this function describe a memory buffer that
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3641 * contains an uncompressed image. The image will be automatically compressed
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3642 * as a JPEG image by the core system of Orthanc.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3643 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3644 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3645 * @param output The HTTP connection to the client application.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3646 * @param format The memory layout of the uncompressed image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3647 * @param width The width of the image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3648 * @param height The height of the image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3649 * @param pitch The pitch of the image (i.e. the number of bytes
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3650 * between 2 successive lines of the image in the memory buffer).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3651 * @param buffer The memory buffer containing the uncompressed image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3652 * @param quality The quality of the JPEG encoding, between 1 (worst
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3653 * quality, best compression) and 100 (best quality, worst
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3654 * compression).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3655 * @ingroup REST
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3656 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3657 ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerJpegImage(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3658 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3659 OrthancPluginRestOutput* output,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3660 OrthancPluginPixelFormat format,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3661 uint32_t width,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3662 uint32_t height,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3663 uint32_t pitch,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3664 const void* buffer,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3665 uint8_t quality)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3666 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3667 _OrthancPluginCompressAndAnswerImage params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3668 params.output = output;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3669 params.imageFormat = OrthancPluginImageFormat_Jpeg;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3670 params.pixelFormat = format;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3671 params.width = width;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3672 params.height = height;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3673 params.pitch = pitch;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3674 params.buffer = buffer;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3675 params.quality = quality;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3676 context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3677 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3678
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3679
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3680
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3681
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3682 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3683 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3684 OrthancPluginMemoryBuffer* target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3685 OrthancPluginHttpMethod method;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3686 const char* url;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3687 const char* username;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3688 const char* password;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3689 const char* body;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3690 uint32_t bodySize;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3691 } _OrthancPluginCallHttpClient;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3692
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3693
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3694 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3695 * @brief Issue a HTTP GET call.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3696 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3697 * Make a HTTP GET call to the given URL. The result to the query is
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3698 * stored into a newly allocated memory buffer. Favor
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3699 * OrthancPluginRestApiGet() if calling the built-in REST API of the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3700 * Orthanc instance that hosts this plugin.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3701 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3702 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3703 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3704 * @param url The URL of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3705 * @param username The username (can be <tt>NULL</tt> if no password protection).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3706 * @param password The password (can be <tt>NULL</tt> if no password protection).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3707 * @return 0 if success, or the error code if failure.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3708 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3709 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpGet(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3710 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3711 OrthancPluginMemoryBuffer* target,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3712 const char* url,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3713 const char* username,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3714 const char* password)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3715 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3716 _OrthancPluginCallHttpClient params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3717 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3718
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3719 params.target = target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3720 params.method = OrthancPluginHttpMethod_Get;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3721 params.url = url;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3722 params.username = username;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3723 params.password = password;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3724
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3725 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3726 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3727
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3728
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3729 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3730 * @brief Issue a HTTP POST call.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3731 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3732 * Make a HTTP POST call to the given URL. The result to the query
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3733 * is stored into a newly allocated memory buffer. Favor
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3734 * OrthancPluginRestApiPost() if calling the built-in REST API of
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3735 * the Orthanc instance that hosts this plugin.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3736 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3737 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3738 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3739 * @param url The URL of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3740 * @param body The content of the body of the request.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3741 * @param bodySize The size of the body of the request.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3742 * @param username The username (can be <tt>NULL</tt> if no password protection).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3743 * @param password The password (can be <tt>NULL</tt> if no password protection).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3744 * @return 0 if success, or the error code if failure.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3745 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3746 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpPost(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3747 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3748 OrthancPluginMemoryBuffer* target,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3749 const char* url,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3750 const char* body,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3751 uint32_t bodySize,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3752 const char* username,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3753 const char* password)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3754 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3755 _OrthancPluginCallHttpClient params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3756 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3757
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3758 params.target = target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3759 params.method = OrthancPluginHttpMethod_Post;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3760 params.url = url;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3761 params.body = body;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3762 params.bodySize = bodySize;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3763 params.username = username;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3764 params.password = password;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3765
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3766 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3767 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3768
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3769
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3770 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3771 * @brief Issue a HTTP PUT call.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3772 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3773 * Make a HTTP PUT call to the given URL. The result to the query is
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3774 * stored into a newly allocated memory buffer. Favor
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3775 * OrthancPluginRestApiPut() if calling the built-in REST API of the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3776 * Orthanc instance that hosts this plugin.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3777 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3778 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3779 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3780 * @param url The URL of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3781 * @param body The content of the body of the request.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3782 * @param bodySize The size of the body of the request.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3783 * @param username The username (can be <tt>NULL</tt> if no password protection).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3784 * @param password The password (can be <tt>NULL</tt> if no password protection).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3785 * @return 0 if success, or the error code if failure.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3786 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3787 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpPut(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3788 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3789 OrthancPluginMemoryBuffer* target,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3790 const char* url,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3791 const char* body,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3792 uint32_t bodySize,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3793 const char* username,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3794 const char* password)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3795 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3796 _OrthancPluginCallHttpClient params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3797 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3798
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3799 params.target = target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3800 params.method = OrthancPluginHttpMethod_Put;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3801 params.url = url;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3802 params.body = body;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3803 params.bodySize = bodySize;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3804 params.username = username;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3805 params.password = password;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3806
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3807 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3808 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3809
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3810
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3811 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3812 * @brief Issue a HTTP DELETE call.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3813 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3814 * Make a HTTP DELETE call to the given URL. Favor
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3815 * OrthancPluginRestApiDelete() if calling the built-in REST API of
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3816 * the Orthanc instance that hosts this plugin.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3817 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3818 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3819 * @param url The URL of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3820 * @param username The username (can be <tt>NULL</tt> if no password protection).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3821 * @param password The password (can be <tt>NULL</tt> if no password protection).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3822 * @return 0 if success, or the error code if failure.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3823 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3824 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpDelete(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3825 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3826 const char* url,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3827 const char* username,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3828 const char* password)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3829 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3830 _OrthancPluginCallHttpClient params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3831 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3832
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3833 params.method = OrthancPluginHttpMethod_Delete;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3834 params.url = url;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3835 params.username = username;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3836 params.password = password;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3837
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3838 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3839 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3840
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3841
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3842
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3843 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3844 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3845 OrthancPluginImage** target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3846 const OrthancPluginImage* source;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3847 OrthancPluginPixelFormat targetFormat;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3848 } _OrthancPluginConvertPixelFormat;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3849
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3850
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3851 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3852 * @brief Change the pixel format of an image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3853 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3854 * This function creates a new image, changing the memory layout of the pixels.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3855 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3856 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3857 * @param source The source image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3858 * @param targetFormat The target pixel format.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3859 * @return The resulting image. It must be freed with OrthancPluginFreeImage().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3860 * @ingroup Images
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3861 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3862 ORTHANC_PLUGIN_INLINE OrthancPluginImage *OrthancPluginConvertPixelFormat(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3863 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3864 const OrthancPluginImage* source,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3865 OrthancPluginPixelFormat targetFormat)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3866 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3867 OrthancPluginImage* target = NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3868
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3869 _OrthancPluginConvertPixelFormat params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3870 params.target = &target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3871 params.source = source;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3872 params.targetFormat = targetFormat;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3873
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3874 if (context->InvokeService(context, _OrthancPluginService_ConvertPixelFormat, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3875 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3876 return NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3877 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3878 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3879 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3880 return target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3881 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3882 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3883
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3884
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3885
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3886 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3887 * @brief Return the number of available fonts.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3888 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3889 * This function returns the number of fonts that are built in the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3890 * Orthanc core. These fonts can be used to draw texts on images
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3891 * through OrthancPluginDrawText().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3892 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3893 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3894 * @return The number of fonts.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3895 * @ingroup Images
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3896 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3897 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontsCount(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3898 OrthancPluginContext* context)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3899 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3900 uint32_t count = 0;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3901
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3902 _OrthancPluginReturnSingleValue params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3903 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3904 params.resultUint32 = &count;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3905
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3906 if (context->InvokeService(context, _OrthancPluginService_GetFontsCount, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3907 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3908 /* Error */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3909 return 0;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3910 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3911 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3912 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3913 return count;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3914 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3915 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3916
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3917
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3918
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3919
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3920 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3921 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3922 uint32_t fontIndex; /* in */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3923 const char** name; /* out */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3924 uint32_t* size; /* out */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3925 } _OrthancPluginGetFontInfo;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3926
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3927 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3928 * @brief Return the name of a font.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3929 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3930 * This function returns the name of a font that is built in the Orthanc core.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3931 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3932 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3933 * @param fontIndex The index of the font. This value must be less than OrthancPluginGetFontsCount().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3934 * @return The font name. This is a statically-allocated string, do not free it.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3935 * @ingroup Images
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3936 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3937 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetFontName(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3938 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3939 uint32_t fontIndex)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3940 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3941 const char* result = NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3942
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3943 _OrthancPluginGetFontInfo params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3944 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3945 params.name = &result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3946 params.fontIndex = fontIndex;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3947
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3948 if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3949 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3950 return NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3951 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3952 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3953 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3954 return result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3955 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3956 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3957
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3958
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3959 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3960 * @brief Return the size of a font.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3961 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3962 * This function returns the size of a font that is built in the Orthanc core.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3963 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3964 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3965 * @param fontIndex The index of the font. This value must be less than OrthancPluginGetFontsCount().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3966 * @return The font size.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3967 * @ingroup Images
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3968 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3969 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontSize(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3970 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3971 uint32_t fontIndex)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3972 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3973 uint32_t result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3974
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3975 _OrthancPluginGetFontInfo params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3976 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3977 params.size = &result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3978 params.fontIndex = fontIndex;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3979
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3980 if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3981 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3982 return 0;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3983 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3984 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3985 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3986 return result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3987 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3988 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3989
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3990
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3991
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3992 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3993 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3994 OrthancPluginImage* image;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3995 uint32_t fontIndex;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3996 const char* utf8Text;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3997 int32_t x;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3998 int32_t y;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3999 uint8_t r;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4000 uint8_t g;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4001 uint8_t b;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4002 } _OrthancPluginDrawText;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4003
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4004
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4005 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4006 * @brief Draw text on an image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4007 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4008 * This function draws some text on some image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4009 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4010 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4011 * @param image The image upon which to draw the text.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4012 * @param fontIndex The index of the font. This value must be less than OrthancPluginGetFontsCount().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4013 * @param utf8Text The text to be drawn, encoded as an UTF-8 zero-terminated string.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4014 * @param x The X position of the text over the image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4015 * @param y The Y position of the text over the image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4016 * @param r The value of the red color channel of the text.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4017 * @param g The value of the green color channel of the text.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4018 * @param b The value of the blue color channel of the text.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4019 * @return 0 if success, other value if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4020 * @ingroup Images
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4021 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4022 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginDrawText(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4023 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4024 OrthancPluginImage* image,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4025 uint32_t fontIndex,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4026 const char* utf8Text,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4027 int32_t x,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4028 int32_t y,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4029 uint8_t r,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4030 uint8_t g,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4031 uint8_t b)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4032 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4033 _OrthancPluginDrawText params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4034 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4035 params.image = image;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4036 params.fontIndex = fontIndex;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4037 params.utf8Text = utf8Text;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4038 params.x = x;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4039 params.y = y;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4040 params.r = r;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4041 params.g = g;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4042 params.b = b;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4043
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4044 return context->InvokeService(context, _OrthancPluginService_DrawText, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4045 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4046
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4047
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4048
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4049 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4050 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4051 OrthancPluginStorageArea* storageArea;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4052 const char* uuid;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4053 const void* content;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4054 uint64_t size;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4055 OrthancPluginContentType type;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4056 } _OrthancPluginStorageAreaCreate;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4057
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4058
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4059 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4060 * @brief Create a file inside the storage area.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4061 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4062 * This function creates a new file inside the storage area that is
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4063 * currently used by Orthanc.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4064 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4065 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4066 * @param storageArea The storage area.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4067 * @param uuid The identifier of the file to be created.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4068 * @param content The content to store in the newly created file.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4069 * @param size The size of the content.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4070 * @param type The type of the file content.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4071 * @return 0 if success, other value if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4072 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4073 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4074 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaCreate(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4075 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4076 OrthancPluginStorageArea* storageArea,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4077 const char* uuid,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4078 const void* content,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4079 uint64_t size,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4080 OrthancPluginContentType type)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4081 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4082 _OrthancPluginStorageAreaCreate params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4083 params.storageArea = storageArea;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4084 params.uuid = uuid;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4085 params.content = content;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4086 params.size = size;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4087 params.type = type;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4088
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4089 return context->InvokeService(context, _OrthancPluginService_StorageAreaCreate, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4090 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4091
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4092
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4093 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4094 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4095 OrthancPluginMemoryBuffer* target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4096 OrthancPluginStorageArea* storageArea;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4097 const char* uuid;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4098 OrthancPluginContentType type;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4099 } _OrthancPluginStorageAreaRead;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4100
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4101
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4102 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4103 * @brief Read a file from the storage area.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4104 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4105 * This function reads the content of a given file from the storage
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4106 * area that is currently used by Orthanc.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4107 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4108 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4109 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4110 * @param storageArea The storage area.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4111 * @param uuid The identifier of the file to be read.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4112 * @param type The type of the file content.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4113 * @return 0 if success, other value if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4114 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4115 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4116 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaRead(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4117 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4118 OrthancPluginMemoryBuffer* target,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4119 OrthancPluginStorageArea* storageArea,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4120 const char* uuid,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4121 OrthancPluginContentType type)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4122 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4123 _OrthancPluginStorageAreaRead params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4124 params.target = target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4125 params.storageArea = storageArea;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4126 params.uuid = uuid;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4127 params.type = type;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4128
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4129 return context->InvokeService(context, _OrthancPluginService_StorageAreaRead, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4130 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4131
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4132
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4133 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4134 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4135 OrthancPluginStorageArea* storageArea;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4136 const char* uuid;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4137 OrthancPluginContentType type;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4138 } _OrthancPluginStorageAreaRemove;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4139
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4140 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4141 * @brief Remove a file from the storage area.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4142 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4143 * This function removes a given file from the storage area that is
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4144 * currently used by Orthanc.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4145 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4146 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4147 * @param storageArea The storage area.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4148 * @param uuid The identifier of the file to be removed.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4149 * @param type The type of the file content.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4150 * @return 0 if success, other value if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4151 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4152 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4153 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaRemove(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4154 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4155 OrthancPluginStorageArea* storageArea,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4156 const char* uuid,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4157 OrthancPluginContentType type)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4158 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4159 _OrthancPluginStorageAreaRemove params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4160 params.storageArea = storageArea;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4161 params.uuid = uuid;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4162 params.type = type;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4163
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4164 return context->InvokeService(context, _OrthancPluginService_StorageAreaRemove, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4165 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4166
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4167
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4168
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4169 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4170 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4171 OrthancPluginErrorCode* target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4172 int32_t code;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4173 uint16_t httpStatus;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4174 const char* message;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4175 } _OrthancPluginRegisterErrorCode;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4176
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4177 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4178 * @brief Declare a custom error code for this plugin.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4179 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4180 * This function declares a custom error code that can be generated
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4181 * by this plugin. This declaration is used to enrich the body of
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4182 * the HTTP answer in the case of an error, and to set the proper
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4183 * HTTP status code.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4184 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4185 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4186 * @param code The error code that is internal to this plugin.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4187 * @param httpStatus The HTTP status corresponding to this error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4188 * @param message The description of the error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4189 * @return The error code that has been assigned inside the Orthanc core.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4190 * @ingroup Toolbox
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4191 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4192 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterErrorCode(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4193 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4194 int32_t code,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4195 uint16_t httpStatus,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4196 const char* message)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4197 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4198 OrthancPluginErrorCode target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4199
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4200 _OrthancPluginRegisterErrorCode params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4201 params.target = &target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4202 params.code = code;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4203 params.httpStatus = httpStatus;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4204 params.message = message;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4205
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4206 if (context->InvokeService(context, _OrthancPluginService_RegisterErrorCode, &params) == OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4207 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4208 return target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4209 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4210 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4211 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4212 /* There was an error while assigned the error. Use a generic code. */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4213 return OrthancPluginErrorCode_Plugin;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4214 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4215 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4216
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4217
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4218
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4219 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4220 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4221 uint16_t group;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4222 uint16_t element;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4223 OrthancPluginValueRepresentation vr;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4224 const char* name;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4225 uint32_t minMultiplicity;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4226 uint32_t maxMultiplicity;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4227 } _OrthancPluginRegisterDictionaryTag;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4228
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4229 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4230 * @brief Register a new tag into the DICOM dictionary.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4231 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4232 * This function declares a new public tag in the dictionary of
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4233 * DICOM tags that are known to Orthanc. This function should be
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4234 * used in the OrthancPluginInitialize() callback.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4235 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4236 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4237 * @param group The group of the tag.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4238 * @param element The element of the tag.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4239 * @param vr The value representation of the tag.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4240 * @param name The nickname of the tag.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4241 * @param minMultiplicity The minimum multiplicity of the tag (must be above 0).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4242 * @param maxMultiplicity The maximum multiplicity of the tag. A value of 0 means
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4243 * an arbitrary multiplicity ("<tt>n</tt>").
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4244 * @return 0 if success, other value if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4245 * @see OrthancPluginRegisterPrivateDictionaryTag()
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4246 * @ingroup Toolbox
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4247 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4248 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterDictionaryTag(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4249 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4250 uint16_t group,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4251 uint16_t element,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4252 OrthancPluginValueRepresentation vr,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4253 const char* name,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4254 uint32_t minMultiplicity,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4255 uint32_t maxMultiplicity)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4256 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4257 _OrthancPluginRegisterDictionaryTag params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4258 params.group = group;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4259 params.element = element;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4260 params.vr = vr;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4261 params.name = name;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4262 params.minMultiplicity = minMultiplicity;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4263 params.maxMultiplicity = maxMultiplicity;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4264
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4265 return context->InvokeService(context, _OrthancPluginService_RegisterDictionaryTag, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4266 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4267
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4268
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4269
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4270 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4271 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4272 uint16_t group;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4273 uint16_t element;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4274 OrthancPluginValueRepresentation vr;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4275 const char* name;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4276 uint32_t minMultiplicity;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4277 uint32_t maxMultiplicity;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4278 const char* privateCreator;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4279 } _OrthancPluginRegisterPrivateDictionaryTag;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4280
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4281 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4282 * @brief Register a new private tag into the DICOM dictionary.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4283 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4284 * This function declares a new private tag in the dictionary of
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4285 * DICOM tags that are known to Orthanc. This function should be
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4286 * used in the OrthancPluginInitialize() callback.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4287 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4288 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4289 * @param group The group of the tag.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4290 * @param element The element of the tag.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4291 * @param vr The value representation of the tag.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4292 * @param name The nickname of the tag.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4293 * @param minMultiplicity The minimum multiplicity of the tag (must be above 0).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4294 * @param maxMultiplicity The maximum multiplicity of the tag. A value of 0 means
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4295 * an arbitrary multiplicity ("<tt>n</tt>").
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4296 * @param privateCreator The private creator of this private tag.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4297 * @return 0 if success, other value if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4298 * @see OrthancPluginRegisterDictionaryTag()
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4299 * @ingroup Toolbox
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4300 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4301 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterPrivateDictionaryTag(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4302 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4303 uint16_t group,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4304 uint16_t element,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4305 OrthancPluginValueRepresentation vr,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4306 const char* name,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4307 uint32_t minMultiplicity,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4308 uint32_t maxMultiplicity,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4309 const char* privateCreator)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4310 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4311 _OrthancPluginRegisterPrivateDictionaryTag params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4312 params.group = group;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4313 params.element = element;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4314 params.vr = vr;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4315 params.name = name;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4316 params.minMultiplicity = minMultiplicity;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4317 params.maxMultiplicity = maxMultiplicity;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4318 params.privateCreator = privateCreator;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4319
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4320 return context->InvokeService(context, _OrthancPluginService_RegisterPrivateDictionaryTag, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4321 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4322
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4323
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4324
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4325 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4326 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4327 OrthancPluginStorageArea* storageArea;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4328 OrthancPluginResourceType level;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4329 } _OrthancPluginReconstructMainDicomTags;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4330
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4331 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4332 * @brief Reconstruct the main DICOM tags.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4333 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4334 * This function requests the Orthanc core to reconstruct the main
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4335 * DICOM tags of all the resources of the given type. This function
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4336 * can only be used as a part of the upgrade of a custom database
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4337 * back-end. A database transaction will be automatically setup.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4338 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4339 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4340 * @param storageArea The storage area.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4341 * @param level The type of the resources of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4342 * @return 0 if success, other value if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4343 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4344 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4345 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginReconstructMainDicomTags(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4346 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4347 OrthancPluginStorageArea* storageArea,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4348 OrthancPluginResourceType level)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4349 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4350 _OrthancPluginReconstructMainDicomTags params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4351 params.level = level;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4352 params.storageArea = storageArea;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4353
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4354 return context->InvokeService(context, _OrthancPluginService_ReconstructMainDicomTags, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4355 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4356
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4357
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4358 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4359 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4360 char** result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4361 const char* instanceId;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4362 const void* buffer;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4363 uint32_t size;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4364 OrthancPluginDicomToJsonFormat format;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4365 OrthancPluginDicomToJsonFlags flags;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4366 uint32_t maxStringLength;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4367 } _OrthancPluginDicomToJson;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4368
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4369
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4370 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4371 * @brief Format a DICOM memory buffer as a JSON string.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4372 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4373 * This function takes as input a memory buffer containing a DICOM
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4374 * file, and outputs a JSON string representing the tags of this
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4375 * DICOM file.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4376 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4377 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4378 * @param buffer The memory buffer containing the DICOM file.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4379 * @param size The size of the memory buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4380 * @param format The output format.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4381 * @param flags Flags governing the output.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4382 * @param maxStringLength The maximum length of a field. Too long fields will
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4383 * be output as "null". The 0 value means no maximum length.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4384 * @return The NULL value if the case of an error, or the JSON
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4385 * string. This string must be freed by OrthancPluginFreeString().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4386 * @ingroup Toolbox
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4387 * @see OrthancPluginDicomInstanceToJson
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4388 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4389 ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomBufferToJson(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4390 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4391 const void* buffer,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4392 uint32_t size,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4393 OrthancPluginDicomToJsonFormat format,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4394 OrthancPluginDicomToJsonFlags flags,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4395 uint32_t maxStringLength)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4396 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4397 char* result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4398
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4399 _OrthancPluginDicomToJson params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4400 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4401 params.result = &result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4402 params.buffer = buffer;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4403 params.size = size;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4404 params.format = format;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4405 params.flags = flags;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4406 params.maxStringLength = maxStringLength;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4407
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4408 if (context->InvokeService(context, _OrthancPluginService_DicomBufferToJson, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4409 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4410 /* Error */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4411 return NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4412 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4413 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4414 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4415 return result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4416 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4417 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4418
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4419
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4420 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4421 * @brief Format a DICOM instance as a JSON string.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4422 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4423 * This function formats a DICOM instance that is stored in Orthanc,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4424 * and outputs a JSON string representing the tags of this DICOM
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4425 * instance.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4426 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4427 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4428 * @param instanceId The Orthanc identifier of the instance.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4429 * @param format The output format.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4430 * @param flags Flags governing the output.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4431 * @param maxStringLength The maximum length of a field. Too long fields will
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4432 * be output as "null". The 0 value means no maximum length.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4433 * @return The NULL value if the case of an error, or the JSON
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4434 * string. This string must be freed by OrthancPluginFreeString().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4435 * @ingroup Toolbox
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4436 * @see OrthancPluginDicomInstanceToJson
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4437 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4438 ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomInstanceToJson(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4439 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4440 const char* instanceId,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4441 OrthancPluginDicomToJsonFormat format,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4442 OrthancPluginDicomToJsonFlags flags,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4443 uint32_t maxStringLength)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4444 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4445 char* result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4446
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4447 _OrthancPluginDicomToJson params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4448 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4449 params.result = &result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4450 params.instanceId = instanceId;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4451 params.format = format;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4452 params.flags = flags;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4453 params.maxStringLength = maxStringLength;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4454
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4455 if (context->InvokeService(context, _OrthancPluginService_DicomInstanceToJson, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4456 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4457 /* Error */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4458 return NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4459 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4460 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4461 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4462 return result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4463 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4464 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4465
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4466
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4467 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4468 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4469 OrthancPluginMemoryBuffer* target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4470 const char* uri;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4471 uint32_t headersCount;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4472 const char* const* headersKeys;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4473 const char* const* headersValues;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4474 int32_t afterPlugins;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4475 } _OrthancPluginRestApiGet2;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4476
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4477 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4478 * @brief Make a GET call to the Orthanc REST API, with custom HTTP headers.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4479 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4480 * Make a GET call to the Orthanc REST API with extended
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4481 * parameters. The result to the query is stored into a newly
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4482 * allocated memory buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4483 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4484 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4485 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4486 * @param uri The URI in the built-in Orthanc API.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4487 * @param headersCount The number of HTTP headers.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4488 * @param headersKeys Array containing the keys of the HTTP headers (can be <tt>NULL</tt> if no header).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4489 * @param headersValues Array containing the values of the HTTP headers (can be <tt>NULL</tt> if no header).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4490 * @param afterPlugins If 0, the built-in API of Orthanc is used.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4491 * If 1, the API is tainted by the plugins.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4492 * @return 0 if success, or the error code if failure.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4493 * @see OrthancPluginRestApiGet, OrthancPluginRestApiGetAfterPlugins
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4494 * @ingroup Orthanc
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4495 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4496 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGet2(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4497 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4498 OrthancPluginMemoryBuffer* target,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4499 const char* uri,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4500 uint32_t headersCount,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4501 const char* const* headersKeys,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4502 const char* const* headersValues,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4503 int32_t afterPlugins)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4504 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4505 _OrthancPluginRestApiGet2 params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4506 params.target = target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4507 params.uri = uri;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4508 params.headersCount = headersCount;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4509 params.headersKeys = headersKeys;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4510 params.headersValues = headersValues;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4511 params.afterPlugins = afterPlugins;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4512
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4513 return context->InvokeService(context, _OrthancPluginService_RestApiGet2, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4514 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4515
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4516
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4517
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4518 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4519 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4520 OrthancPluginWorklistCallback callback;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4521 } _OrthancPluginWorklistCallback;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4522
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4523 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4524 * @brief Register a callback to handle modality worklists requests.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4525 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4526 * This function registers a callback to handle C-Find SCP requests
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4527 * on modality worklists.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4528 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4529 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4530 * @param callback The callback.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4531 * @return 0 if success, other value if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4532 * @ingroup DicomCallbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4533 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4534 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterWorklistCallback(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4535 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4536 OrthancPluginWorklistCallback callback)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4537 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4538 _OrthancPluginWorklistCallback params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4539 params.callback = callback;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4540
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4541 return context->InvokeService(context, _OrthancPluginService_RegisterWorklistCallback, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4542 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4543
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4544
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4545
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4546 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4547 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4548 OrthancPluginWorklistAnswers* answers;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4549 const OrthancPluginWorklistQuery* query;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4550 const void* dicom;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4551 uint32_t size;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4552 } _OrthancPluginWorklistAnswersOperation;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4553
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4554 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4555 * @brief Add one answer to some modality worklist request.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4556 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4557 * This function adds one worklist (encoded as a DICOM file) to the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4558 * set of answers corresponding to some C-Find SCP request against
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4559 * modality worklists.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4560 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4561 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4562 * @param answers The set of answers.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4563 * @param query The worklist query, as received by the callback.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4564 * @param dicom The worklist to answer, encoded as a DICOM file.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4565 * @param size The size of the DICOM file.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4566 * @return 0 if success, other value if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4567 * @ingroup DicomCallbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4568 * @see OrthancPluginCreateDicom()
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4569 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4570 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistAddAnswer(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4571 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4572 OrthancPluginWorklistAnswers* answers,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4573 const OrthancPluginWorklistQuery* query,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4574 const void* dicom,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4575 uint32_t size)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4576 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4577 _OrthancPluginWorklistAnswersOperation params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4578 params.answers = answers;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4579 params.query = query;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4580 params.dicom = dicom;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4581 params.size = size;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4582
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4583 return context->InvokeService(context, _OrthancPluginService_WorklistAddAnswer, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4584 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4585
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4586
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4587 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4588 * @brief Mark the set of worklist answers as incomplete.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4589 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4590 * This function marks as incomplete the set of answers
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4591 * corresponding to some C-Find SCP request against modality
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4592 * worklists. This must be used if canceling the handling of a
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4593 * request when too many answers are to be returned.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4594 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4595 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4596 * @param answers The set of answers.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4597 * @return 0 if success, other value if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4598 * @ingroup DicomCallbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4599 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4600 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistMarkIncomplete(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4601 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4602 OrthancPluginWorklistAnswers* answers)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4603 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4604 _OrthancPluginWorklistAnswersOperation params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4605 params.answers = answers;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4606 params.query = NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4607 params.dicom = NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4608 params.size = 0;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4609
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4610 return context->InvokeService(context, _OrthancPluginService_WorklistMarkIncomplete, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4611 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4612
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4613
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4614 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4615 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4616 const OrthancPluginWorklistQuery* query;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4617 const void* dicom;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4618 uint32_t size;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4619 int32_t* isMatch;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4620 OrthancPluginMemoryBuffer* target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4621 } _OrthancPluginWorklistQueryOperation;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4622
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4623 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4624 * @brief Test whether a worklist matches the query.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4625 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4626 * This function checks whether one worklist (encoded as a DICOM
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4627 * file) matches the C-Find SCP query against modality
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4628 * worklists. This function must be called before adding the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4629 * worklist as an answer through OrthancPluginWorklistAddAnswer().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4630 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4631 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4632 * @param query The worklist query, as received by the callback.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4633 * @param dicom The worklist to answer, encoded as a DICOM file.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4634 * @param size The size of the DICOM file.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4635 * @return 1 if the worklist matches the query, 0 otherwise.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4636 * @ingroup DicomCallbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4637 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4638 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginWorklistIsMatch(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4639 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4640 const OrthancPluginWorklistQuery* query,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4641 const void* dicom,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4642 uint32_t size)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4643 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4644 int32_t isMatch = 0;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4645
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4646 _OrthancPluginWorklistQueryOperation params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4647 params.query = query;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4648 params.dicom = dicom;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4649 params.size = size;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4650 params.isMatch = &isMatch;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4651 params.target = NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4652
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4653 if (context->InvokeService(context, _OrthancPluginService_WorklistIsMatch, &params) == OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4654 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4655 return isMatch;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4656 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4657 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4658 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4659 /* Error: Assume non-match */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4660 return 0;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4661 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4662 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4663
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4664
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4665 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4666 * @brief Retrieve the worklist query as a DICOM file.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4667 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4668 * This function retrieves the DICOM file that underlies a C-Find
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4669 * SCP query against modality worklists.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4670 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4671 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4672 * @param target Memory buffer where to store the DICOM file. It must be freed with OrthancPluginFreeMemoryBuffer().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4673 * @param query The worklist query, as received by the callback.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4674 * @return 0 if success, other value if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4675 * @ingroup DicomCallbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4676 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4677 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistGetDicomQuery(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4678 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4679 OrthancPluginMemoryBuffer* target,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4680 const OrthancPluginWorklistQuery* query)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4681 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4682 _OrthancPluginWorklistQueryOperation params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4683 params.query = query;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4684 params.dicom = NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4685 params.size = 0;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4686 params.isMatch = NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4687 params.target = target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4688
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4689 return context->InvokeService(context, _OrthancPluginService_WorklistGetDicomQuery, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4690 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4691
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4692
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4693 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4694 * @brief Get the origin of a DICOM file.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4695 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4696 * This function returns the origin of a DICOM instance that has been received by Orthanc.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4697 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4698 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4699 * @param instance The instance of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4700 * @return The origin of the instance.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4701 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4702 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4703 ORTHANC_PLUGIN_INLINE OrthancPluginInstanceOrigin OrthancPluginGetInstanceOrigin(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4704 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4705 OrthancPluginDicomInstance* instance)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4706 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4707 OrthancPluginInstanceOrigin origin;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4708
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4709 _OrthancPluginAccessDicomInstance params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4710 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4711 params.resultOrigin = &origin;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4712 params.instance = instance;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4713
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4714 if (context->InvokeService(context, _OrthancPluginService_GetInstanceOrigin, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4715 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4716 /* Error */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4717 return OrthancPluginInstanceOrigin_Unknown;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4718 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4719 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4720 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4721 return origin;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4722 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4723 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4724
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4725
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4726 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4727 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4728 OrthancPluginMemoryBuffer* target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4729 const char* json;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4730 const OrthancPluginImage* pixelData;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4731 OrthancPluginCreateDicomFlags flags;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4732 } _OrthancPluginCreateDicom;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4733
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4734 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4735 * @brief Create a DICOM instance from a JSON string and an image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4736 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4737 * This function takes as input a string containing a JSON file
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4738 * describing the content of a DICOM instance. As an output, it
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4739 * writes the corresponding DICOM instance to a newly allocated
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4740 * memory buffer. Additionally, an image to be encoded within the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4741 * DICOM instance can also be provided.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4742 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4743 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4744 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4745 * @param json The input JSON file.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4746 * @param pixelData The image. Can be NULL, if the pixel data is encoded inside the JSON with the data URI scheme.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4747 * @param flags Flags governing the output.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4748 * @return 0 if success, other value if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4749 * @ingroup Toolbox
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4750 * @see OrthancPluginDicomBufferToJson
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4751 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4752 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCreateDicom(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4753 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4754 OrthancPluginMemoryBuffer* target,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4755 const char* json,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4756 const OrthancPluginImage* pixelData,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4757 OrthancPluginCreateDicomFlags flags)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4758 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4759 _OrthancPluginCreateDicom params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4760 params.target = target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4761 params.json = json;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4762 params.pixelData = pixelData;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4763 params.flags = flags;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4764
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4765 return context->InvokeService(context, _OrthancPluginService_CreateDicom, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4766 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4767
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4768
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4769 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4770 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4771 OrthancPluginDecodeImageCallback callback;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4772 } _OrthancPluginDecodeImageCallback;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4773
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4774 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4775 * @brief Register a callback to handle the decoding of DICOM images.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4776 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4777 * This function registers a custom callback to the decoding of
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4778 * DICOM images, replacing the built-in decoder of Orthanc.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4779 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4780 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4781 * @param callback The callback.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4782 * @return 0 if success, other value if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4783 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4784 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4785 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterDecodeImageCallback(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4786 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4787 OrthancPluginDecodeImageCallback callback)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4788 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4789 _OrthancPluginDecodeImageCallback params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4790 params.callback = callback;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4791
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4792 return context->InvokeService(context, _OrthancPluginService_RegisterDecodeImageCallback, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4793 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4794
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4795
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4796
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4797 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4798 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4799 OrthancPluginImage** target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4800 OrthancPluginPixelFormat format;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4801 uint32_t width;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4802 uint32_t height;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4803 uint32_t pitch;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4804 void* buffer;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4805 const void* constBuffer;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4806 uint32_t bufferSize;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4807 uint32_t frameIndex;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4808 } _OrthancPluginCreateImage;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4809
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4810
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4811 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4812 * @brief Create an image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4813 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4814 * This function creates an image of given size and format.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4815 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4816 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4817 * @param format The format of the pixels.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4818 * @param width The width of the image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4819 * @param height The height of the image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4820 * @return The newly allocated image. It must be freed with OrthancPluginFreeImage().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4821 * @ingroup Images
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4822 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4823 ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginCreateImage(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4824 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4825 OrthancPluginPixelFormat format,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4826 uint32_t width,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4827 uint32_t height)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4828 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4829 OrthancPluginImage* target = NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4830
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4831 _OrthancPluginCreateImage params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4832 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4833 params.target = &target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4834 params.format = format;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4835 params.width = width;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4836 params.height = height;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4837
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4838 if (context->InvokeService(context, _OrthancPluginService_CreateImage, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4839 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4840 return NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4841 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4842 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4843 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4844 return target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4845 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4846 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4847
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4848
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4849 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4850 * @brief Create an image pointing to a memory buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4851 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4852 * This function creates an image whose content points to a memory
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4853 * buffer managed by the plugin. Note that the buffer is directly
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4854 * accessed, no memory is allocated and no data is copied.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4855 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4856 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4857 * @param format The format of the pixels.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4858 * @param width The width of the image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4859 * @param height The height of the image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4860 * @param pitch The pitch of the image (i.e. the number of bytes
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4861 * between 2 successive lines of the image in the memory buffer).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4862 * @param buffer The memory buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4863 * @return The newly allocated image. It must be freed with OrthancPluginFreeImage().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4864 * @ingroup Images
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4865 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4866 ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginCreateImageAccessor(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4867 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4868 OrthancPluginPixelFormat format,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4869 uint32_t width,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4870 uint32_t height,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4871 uint32_t pitch,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4872 void* buffer)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4873 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4874 OrthancPluginImage* target = NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4875
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4876 _OrthancPluginCreateImage params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4877 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4878 params.target = &target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4879 params.format = format;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4880 params.width = width;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4881 params.height = height;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4882 params.pitch = pitch;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4883 params.buffer = buffer;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4884
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4885 if (context->InvokeService(context, _OrthancPluginService_CreateImageAccessor, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4886 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4887 return NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4888 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4889 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4890 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4891 return target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4892 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4893 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4894
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4895
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4896
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4897 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4898 * @brief Decode one frame from a DICOM instance.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4899 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4900 * This function decodes one frame of a DICOM image that is stored
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4901 * in a memory buffer. This function will give the same result as
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4902 * OrthancPluginUncompressImage() for single-frame DICOM images.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4903 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4904 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4905 * @param buffer Pointer to a memory buffer containing the DICOM image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4906 * @param bufferSize Size of the memory buffer containing the DICOM image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4907 * @param frameIndex The index of the frame of interest in a multi-frame image.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4908 * @return The uncompressed image. It must be freed with OrthancPluginFreeImage().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4909 * @ingroup Images
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4910 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4911 ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginDecodeDicomImage(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4912 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4913 const void* buffer,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4914 uint32_t bufferSize,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4915 uint32_t frameIndex)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4916 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4917 OrthancPluginImage* target = NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4918
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4919 _OrthancPluginCreateImage params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4920 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4921 params.target = &target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4922 params.constBuffer = buffer;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4923 params.bufferSize = bufferSize;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4924 params.frameIndex = frameIndex;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4925
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4926 if (context->InvokeService(context, _OrthancPluginService_DecodeDicomImage, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4927 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4928 return NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4929 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4930 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4931 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4932 return target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4933 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4934 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4935
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4936
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4937
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4938 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4939 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4940 char** result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4941 const void* buffer;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4942 uint32_t size;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4943 } _OrthancPluginComputeHash;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4944
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4945 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4946 * @brief Compute an MD5 hash.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4947 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4948 * This functions computes the MD5 cryptographic hash of the given memory buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4949 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4950 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4951 * @param buffer The source memory buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4952 * @param size The size in bytes of the source buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4953 * @return The NULL value in case of error, or a string containing the cryptographic hash.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4954 * This string must be freed by OrthancPluginFreeString().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4955 * @ingroup Toolbox
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4956 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4957 ORTHANC_PLUGIN_INLINE char* OrthancPluginComputeMd5(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4958 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4959 const void* buffer,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4960 uint32_t size)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4961 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4962 char* result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4963
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4964 _OrthancPluginComputeHash params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4965 params.result = &result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4966 params.buffer = buffer;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4967 params.size = size;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4968
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4969 if (context->InvokeService(context, _OrthancPluginService_ComputeMd5, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4970 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4971 /* Error */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4972 return NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4973 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4974 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4975 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4976 return result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4977 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4978 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4979
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4980
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4981 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4982 * @brief Compute a SHA-1 hash.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4983 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4984 * This functions computes the SHA-1 cryptographic hash of the given memory buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4985 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4986 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4987 * @param buffer The source memory buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4988 * @param size The size in bytes of the source buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4989 * @return The NULL value in case of error, or a string containing the cryptographic hash.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4990 * This string must be freed by OrthancPluginFreeString().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4991 * @ingroup Toolbox
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4992 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4993 ORTHANC_PLUGIN_INLINE char* OrthancPluginComputeSha1(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4994 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4995 const void* buffer,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4996 uint32_t size)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4997 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4998 char* result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4999
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5000 _OrthancPluginComputeHash params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5001 params.result = &result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5002 params.buffer = buffer;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5003 params.size = size;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5004
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5005 if (context->InvokeService(context, _OrthancPluginService_ComputeSha1, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5006 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5007 /* Error */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5008 return NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5009 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5010 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5011 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5012 return result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5013 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5014 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5015
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5016
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5017
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5018 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5019 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5020 OrthancPluginDictionaryEntry* target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5021 const char* name;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5022 } _OrthancPluginLookupDictionary;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5023
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5024 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5025 * @brief Get information about the given DICOM tag.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5026 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5027 * This functions makes a lookup in the dictionary of DICOM tags
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5028 * that are known to Orthanc, and returns information about this
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5029 * tag. The tag can be specified using its human-readable name
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5030 * (e.g. "PatientName") or a set of two hexadecimal numbers
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5031 * (e.g. "0010-0020").
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5032 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5033 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5034 * @param target Where to store the information about the tag.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5035 * @param name The name of the DICOM tag.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5036 * @return 0 if success, other value if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5037 * @ingroup Toolbox
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5038 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5039 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginLookupDictionary(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5040 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5041 OrthancPluginDictionaryEntry* target,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5042 const char* name)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5043 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5044 _OrthancPluginLookupDictionary params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5045 params.target = target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5046 params.name = name;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5047 return context->InvokeService(context, _OrthancPluginService_LookupDictionary, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5048 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5049
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5050
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5051
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5052 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5053 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5054 OrthancPluginRestOutput* output;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5055 const char* answer;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5056 uint32_t answerSize;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5057 uint32_t headersCount;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5058 const char* const* headersKeys;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5059 const char* const* headersValues;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5060 } _OrthancPluginSendMultipartItem2;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5061
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5062 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5063 * @brief Send an item as a part of some HTTP multipart answer, with custom headers.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5064 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5065 * This function sends an item as a part of some HTTP multipart
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5066 * answer that was initiated by OrthancPluginStartMultipartAnswer(). In addition to
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5067 * OrthancPluginSendMultipartItem(), this function will set HTTP header associated
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5068 * with the item.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5069 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5070 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5071 * @param output The HTTP connection to the client application.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5072 * @param answer Pointer to the memory buffer containing the item.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5073 * @param answerSize Number of bytes of the item.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5074 * @param headersCount The number of HTTP headers.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5075 * @param headersKeys Array containing the keys of the HTTP headers.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5076 * @param headersValues Array containing the values of the HTTP headers.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5077 * @return 0 if success, or the error code if failure (this notably happens
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5078 * if the connection is closed by the client).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5079 * @see OrthancPluginSendMultipartItem()
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5080 * @ingroup REST
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5081 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5082 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSendMultipartItem2(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5083 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5084 OrthancPluginRestOutput* output,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5085 const char* answer,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5086 uint32_t answerSize,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5087 uint32_t headersCount,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5088 const char* const* headersKeys,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5089 const char* const* headersValues)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5090 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5091 _OrthancPluginSendMultipartItem2 params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5092 params.output = output;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5093 params.answer = answer;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5094 params.answerSize = answerSize;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5095 params.headersCount = headersCount;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5096 params.headersKeys = headersKeys;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5097 params.headersValues = headersValues;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5098
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5099 return context->InvokeService(context, _OrthancPluginService_SendMultipartItem2, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5100 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5101
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5102
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5103 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5104 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5105 OrthancPluginIncomingHttpRequestFilter callback;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5106 } _OrthancPluginIncomingHttpRequestFilter;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5107
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5108 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5109 * @brief Register a callback to filter incoming HTTP requests.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5110 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5111 * This function registers a custom callback to filter incoming HTTP/REST
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5112 * requests received by the HTTP server of Orthanc.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5113 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5114 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5115 * @param callback The callback.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5116 * @return 0 if success, other value if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5117 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5118 * @deprecated Please instead use OrthancPluginRegisterIncomingHttpRequestFilter2()
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5119 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5120 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5121 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5122 OrthancPluginIncomingHttpRequestFilter callback)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5123 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5124 _OrthancPluginIncomingHttpRequestFilter params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5125 params.callback = callback;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5126
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5127 return context->InvokeService(context, _OrthancPluginService_RegisterIncomingHttpRequestFilter, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5128 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5129
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5130
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5131
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5132 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5133 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5134 OrthancPluginMemoryBuffer* answerBody;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5135 OrthancPluginMemoryBuffer* answerHeaders;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5136 uint16_t* httpStatus;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5137 OrthancPluginHttpMethod method;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5138 const char* url;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5139 uint32_t headersCount;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5140 const char* const* headersKeys;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5141 const char* const* headersValues;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5142 const char* body;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5143 uint32_t bodySize;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5144 const char* username;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5145 const char* password;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5146 uint32_t timeout;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5147 const char* certificateFile;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5148 const char* certificateKeyFile;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5149 const char* certificateKeyPassword;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5150 uint8_t pkcs11;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5151 } _OrthancPluginCallHttpClient2;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5152
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5153
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5154
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5155 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5156 * @brief Issue a HTTP call with full flexibility.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5157 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5158 * Make a HTTP call to the given URL. The result to the query is
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5159 * stored into a newly allocated memory buffer. The HTTP request
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5160 * will be done accordingly to the global configuration of Orthanc
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5161 * (in particular, the options "HttpProxy", "HttpTimeout",
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5162 * "HttpsVerifyPeers", "HttpsCACertificates", and "Pkcs11" will be
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5163 * taken into account).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5164 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5165 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5166 * @param answerBody The target memory buffer (out argument).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5167 * It must be freed with OrthancPluginFreeMemoryBuffer().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5168 * @param answerHeaders The target memory buffer for the HTTP headers in the answers (out argument).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5169 * The answer headers are formatted as a JSON object (associative array).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5170 * The buffer must be freed with OrthancPluginFreeMemoryBuffer().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5171 * This argument can be set to NULL if the plugin has no interest in the HTTP headers.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5172 * @param httpStatus The HTTP status after the execution of the request (out argument).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5173 * @param method HTTP method to be used.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5174 * @param url The URL of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5175 * @param headersCount The number of HTTP headers.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5176 * @param headersKeys Array containing the keys of the HTTP headers (can be <tt>NULL</tt> if no header).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5177 * @param headersValues Array containing the values of the HTTP headers (can be <tt>NULL</tt> if no header).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5178 * @param username The username (can be <tt>NULL</tt> if no password protection).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5179 * @param password The password (can be <tt>NULL</tt> if no password protection).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5180 * @param body The body of the POST request.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5181 * @param bodySize The size of the body.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5182 * @param timeout Timeout in seconds (0 for default timeout).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5183 * @param certificateFile Path to the client certificate for HTTPS, in PEM format
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5184 * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5185 * @param certificateKeyFile Path to the key of the client certificate for HTTPS, in PEM format
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5186 * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5187 * @param certificateKeyPassword Password to unlock the key of the client certificate
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5188 * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5189 * @param pkcs11 Enable PKCS#11 client authentication for hardware security modules and smart cards.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5190 * @return 0 if success, or the error code if failure.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5191 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5192 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpClient(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5193 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5194 OrthancPluginMemoryBuffer* answerBody,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5195 OrthancPluginMemoryBuffer* answerHeaders,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5196 uint16_t* httpStatus,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5197 OrthancPluginHttpMethod method,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5198 const char* url,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5199 uint32_t headersCount,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5200 const char* const* headersKeys,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5201 const char* const* headersValues,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5202 const char* body,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5203 uint32_t bodySize,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5204 const char* username,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5205 const char* password,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5206 uint32_t timeout,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5207 const char* certificateFile,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5208 const char* certificateKeyFile,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5209 const char* certificateKeyPassword,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5210 uint8_t pkcs11)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5211 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5212 _OrthancPluginCallHttpClient2 params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5213 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5214
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5215 params.answerBody = answerBody;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5216 params.answerHeaders = answerHeaders;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5217 params.httpStatus = httpStatus;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5218 params.method = method;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5219 params.url = url;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5220 params.headersCount = headersCount;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5221 params.headersKeys = headersKeys;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5222 params.headersValues = headersValues;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5223 params.body = body;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5224 params.bodySize = bodySize;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5225 params.username = username;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5226 params.password = password;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5227 params.timeout = timeout;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5228 params.certificateFile = certificateFile;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5229 params.certificateKeyFile = certificateKeyFile;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5230 params.certificateKeyPassword = certificateKeyPassword;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5231 params.pkcs11 = pkcs11;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5232
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5233 return context->InvokeService(context, _OrthancPluginService_CallHttpClient2, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5234 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5235
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5236
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5237 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5238 * @brief Generate an UUID.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5239 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5240 * Generate a random GUID/UUID (globally unique identifier).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5241 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5242 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5243 * @return NULL in the case of an error, or a newly allocated string
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5244 * containing the UUID. This string must be freed by OrthancPluginFreeString().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5245 * @ingroup Toolbox
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5246 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5247 ORTHANC_PLUGIN_INLINE char* OrthancPluginGenerateUuid(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5248 OrthancPluginContext* context)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5249 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5250 char* result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5251
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5252 _OrthancPluginRetrieveDynamicString params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5253 params.result = &result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5254 params.argument = NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5255
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5256 if (context->InvokeService(context, _OrthancPluginService_GenerateUuid, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5257 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5258 /* Error */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5259 return NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5260 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5261 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5262 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5263 return result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5264 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5265 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5266
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5267
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5268
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5269
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5270 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5271 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5272 OrthancPluginFindCallback callback;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5273 } _OrthancPluginFindCallback;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5274
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5275 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5276 * @brief Register a callback to handle C-Find requests.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5277 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5278 * This function registers a callback to handle C-Find SCP requests
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5279 * that are not related to modality worklists.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5280 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5281 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5282 * @param callback The callback.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5283 * @return 0 if success, other value if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5284 * @ingroup DicomCallbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5285 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5286 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterFindCallback(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5287 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5288 OrthancPluginFindCallback callback)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5289 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5290 _OrthancPluginFindCallback params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5291 params.callback = callback;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5292
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5293 return context->InvokeService(context, _OrthancPluginService_RegisterFindCallback, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5294 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5295
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5296
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5297 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5298 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5299 OrthancPluginFindAnswers *answers;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5300 const OrthancPluginFindQuery *query;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5301 const void *dicom;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5302 uint32_t size;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5303 uint32_t index;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5304 uint32_t *resultUint32;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5305 uint16_t *resultGroup;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5306 uint16_t *resultElement;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5307 char **resultString;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5308 } _OrthancPluginFindOperation;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5309
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5310 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5311 * @brief Add one answer to some C-Find request.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5312 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5313 * This function adds one answer (encoded as a DICOM file) to the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5314 * set of answers corresponding to some C-Find SCP request that is
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5315 * not related to modality worklists.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5316 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5317 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5318 * @param answers The set of answers.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5319 * @param dicom The answer to be added, encoded as a DICOM file.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5320 * @param size The size of the DICOM file.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5321 * @return 0 if success, other value if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5322 * @ingroup DicomCallbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5323 * @see OrthancPluginCreateDicom()
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5324 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5325 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginFindAddAnswer(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5326 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5327 OrthancPluginFindAnswers* answers,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5328 const void* dicom,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5329 uint32_t size)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5330 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5331 _OrthancPluginFindOperation params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5332 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5333 params.answers = answers;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5334 params.dicom = dicom;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5335 params.size = size;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5336
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5337 return context->InvokeService(context, _OrthancPluginService_FindAddAnswer, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5338 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5339
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5340
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5341 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5342 * @brief Mark the set of C-Find answers as incomplete.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5343 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5344 * This function marks as incomplete the set of answers
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5345 * corresponding to some C-Find SCP request that is not related to
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5346 * modality worklists. This must be used if canceling the handling
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5347 * of a request when too many answers are to be returned.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5348 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5349 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5350 * @param answers The set of answers.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5351 * @return 0 if success, other value if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5352 * @ingroup DicomCallbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5353 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5354 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginFindMarkIncomplete(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5355 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5356 OrthancPluginFindAnswers* answers)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5357 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5358 _OrthancPluginFindOperation params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5359 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5360 params.answers = answers;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5361
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5362 return context->InvokeService(context, _OrthancPluginService_FindMarkIncomplete, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5363 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5364
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5365
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5366
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5367 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5368 * @brief Get the number of tags in a C-Find query.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5369 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5370 * This function returns the number of tags that are contained in
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5371 * the given C-Find query.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5372 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5373 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5374 * @param query The C-Find query.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5375 * @return The number of tags.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5376 * @ingroup DicomCallbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5377 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5378 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFindQuerySize(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5379 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5380 const OrthancPluginFindQuery* query)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5381 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5382 uint32_t count = 0;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5383
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5384 _OrthancPluginFindOperation params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5385 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5386 params.query = query;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5387 params.resultUint32 = &count;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5388
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5389 if (context->InvokeService(context, _OrthancPluginService_GetFindQuerySize, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5390 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5391 /* Error */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5392 return 0;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5393 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5394 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5395 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5396 return count;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5397 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5398 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5399
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5400
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5401 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5402 * @brief Get one tag in a C-Find query.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5403 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5404 * This function returns the group and the element of one DICOM tag
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5405 * in the given C-Find query.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5406 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5407 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5408 * @param group The group of the tag (output).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5409 * @param element The element of the tag (output).
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5410 * @param query The C-Find query.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5411 * @param index The index of the tag of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5412 * @return 0 if success, other value if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5413 * @ingroup DicomCallbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5414 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5415 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginGetFindQueryTag(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5416 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5417 uint16_t* group,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5418 uint16_t* element,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5419 const OrthancPluginFindQuery* query,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5420 uint32_t index)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5421 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5422 _OrthancPluginFindOperation params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5423 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5424 params.query = query;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5425 params.index = index;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5426 params.resultGroup = group;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5427 params.resultElement = element;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5428
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5429 return context->InvokeService(context, _OrthancPluginService_GetFindQueryTag, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5430 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5431
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5432
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5433 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5434 * @brief Get the symbolic name of one tag in a C-Find query.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5435 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5436 * This function returns the symbolic name of one DICOM tag in the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5437 * given C-Find query.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5438 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5439 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5440 * @param query The C-Find query.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5441 * @param index The index of the tag of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5442 * @return The NULL value in case of error, or a string containing the name of the tag.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5443 * @return 0 if success, other value if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5444 * @ingroup DicomCallbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5445 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5446 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetFindQueryTagName(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5447 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5448 const OrthancPluginFindQuery* query,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5449 uint32_t index)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5450 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5451 char* result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5452
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5453 _OrthancPluginFindOperation params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5454 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5455 params.query = query;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5456 params.index = index;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5457 params.resultString = &result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5458
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5459 if (context->InvokeService(context, _OrthancPluginService_GetFindQueryTagName, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5460 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5461 /* Error */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5462 return NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5463 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5464 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5465 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5466 return result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5467 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5468 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5469
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5470
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5471 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5472 * @brief Get the value associated with one tag in a C-Find query.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5473 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5474 * This function returns the value associated with one tag in the
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5475 * given C-Find query.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5476 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5477 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5478 * @param query The C-Find query.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5479 * @param index The index of the tag of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5480 * @return The NULL value in case of error, or a string containing the value of the tag.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5481 * @return 0 if success, other value if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5482 * @ingroup DicomCallbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5483 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5484 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetFindQueryValue(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5485 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5486 const OrthancPluginFindQuery* query,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5487 uint32_t index)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5488 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5489 char* result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5490
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5491 _OrthancPluginFindOperation params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5492 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5493 params.query = query;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5494 params.index = index;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5495 params.resultString = &result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5496
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5497 if (context->InvokeService(context, _OrthancPluginService_GetFindQueryValue, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5498 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5499 /* Error */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5500 return NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5501 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5502 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5503 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5504 return result;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5505 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5506 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5507
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5508
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5509
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5510
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5511 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5512 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5513 OrthancPluginMoveCallback callback;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5514 OrthancPluginGetMoveSize getMoveSize;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5515 OrthancPluginApplyMove applyMove;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5516 OrthancPluginFreeMove freeMove;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5517 } _OrthancPluginMoveCallback;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5518
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5519 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5520 * @brief Register a callback to handle C-Move requests.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5521 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5522 * This function registers a callback to handle C-Move SCP requests.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5523 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5524 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5525 * @param callback The main callback.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5526 * @param getMoveSize Callback to read the number of C-Move suboperations.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5527 * @param applyMove Callback to apply one C-Move suboperations.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5528 * @param freeMove Callback to free the C-Move driver.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5529 * @return 0 if success, other value if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5530 * @ingroup DicomCallbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5531 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5532 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterMoveCallback(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5533 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5534 OrthancPluginMoveCallback callback,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5535 OrthancPluginGetMoveSize getMoveSize,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5536 OrthancPluginApplyMove applyMove,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5537 OrthancPluginFreeMove freeMove)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5538 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5539 _OrthancPluginMoveCallback params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5540 params.callback = callback;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5541 params.getMoveSize = getMoveSize;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5542 params.applyMove = applyMove;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5543 params.freeMove = freeMove;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5544
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5545 return context->InvokeService(context, _OrthancPluginService_RegisterMoveCallback, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5546 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5547
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5548
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5549
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5550 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5551 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5552 OrthancPluginFindMatcher** target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5553 const void* query;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5554 uint32_t size;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5555 } _OrthancPluginCreateFindMatcher;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5556
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5557
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5558 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5559 * @brief Create a C-Find matcher.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5560 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5561 * This function creates a "matcher" object that can be used to
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5562 * check whether a DICOM instance matches a C-Find query. The C-Find
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5563 * query must be expressed as a DICOM buffer.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5564 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5565 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5566 * @param query The C-Find DICOM query.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5567 * @param size The size of the DICOM query.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5568 * @return The newly allocated matcher. It must be freed with OrthancPluginFreeFindMatcher().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5569 * @ingroup Toolbox
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5570 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5571 ORTHANC_PLUGIN_INLINE OrthancPluginFindMatcher* OrthancPluginCreateFindMatcher(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5572 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5573 const void* query,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5574 uint32_t size)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5575 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5576 OrthancPluginFindMatcher* target = NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5577
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5578 _OrthancPluginCreateFindMatcher params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5579 memset(&params, 0, sizeof(params));
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5580 params.target = &target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5581 params.query = query;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5582 params.size = size;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5583
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5584 if (context->InvokeService(context, _OrthancPluginService_CreateFindMatcher, &params) != OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5585 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5586 return NULL;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5587 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5588 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5589 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5590 return target;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5591 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5592 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5593
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5594
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5595 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5596 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5597 OrthancPluginFindMatcher* matcher;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5598 } _OrthancPluginFreeFindMatcher;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5599
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5600 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5601 * @brief Free a C-Find matcher.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5602 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5603 * This function frees a matcher that was created using OrthancPluginCreateFindMatcher().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5604 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5605 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5606 * @param matcher The matcher of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5607 * @ingroup Toolbox
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5608 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5609 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeFindMatcher(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5610 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5611 OrthancPluginFindMatcher* matcher)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5612 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5613 _OrthancPluginFreeFindMatcher params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5614 params.matcher = matcher;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5615
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5616 context->InvokeService(context, _OrthancPluginService_FreeFindMatcher, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5617 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5618
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5619
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5620 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5621 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5622 const OrthancPluginFindMatcher* matcher;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5623 const void* dicom;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5624 uint32_t size;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5625 int32_t* isMatch;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5626 } _OrthancPluginFindMatcherIsMatch;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5627
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5628 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5629 * @brief Test whether a DICOM instance matches a C-Find query.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5630 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5631 * This function checks whether one DICOM instance matches C-Find
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5632 * matcher that was previously allocated using
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5633 * OrthancPluginCreateFindMatcher().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5634 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5635 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5636 * @param matcher The matcher of interest.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5637 * @param dicom The DICOM instance to be matched.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5638 * @param size The size of the DICOM instance.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5639 * @return 1 if the DICOM instance matches the query, 0 otherwise.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5640 * @ingroup Toolbox
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5641 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5642 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginFindMatcherIsMatch(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5643 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5644 const OrthancPluginFindMatcher* matcher,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5645 const void* dicom,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5646 uint32_t size)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5647 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5648 int32_t isMatch = 0;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5649
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5650 _OrthancPluginFindMatcherIsMatch params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5651 params.matcher = matcher;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5652 params.dicom = dicom;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5653 params.size = size;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5654 params.isMatch = &isMatch;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5655
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5656 if (context->InvokeService(context, _OrthancPluginService_FindMatcherIsMatch, &params) == OrthancPluginErrorCode_Success)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5657 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5658 return isMatch;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5659 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5660 else
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5661 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5662 /* Error: Assume non-match */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5663 return 0;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5664 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5665 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5666
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5667
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5668 typedef struct
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5669 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5670 OrthancPluginIncomingHttpRequestFilter2 callback;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5671 } _OrthancPluginIncomingHttpRequestFilter2;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5672
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5673 /**
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5674 * @brief Register a callback to filter incoming HTTP requests.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5675 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5676 * This function registers a custom callback to filter incoming HTTP/REST
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5677 * requests received by the HTTP server of Orthanc.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5678 *
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5679 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5680 * @param callback The callback.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5681 * @return 0 if success, other value if error.
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5682 * @ingroup Callbacks
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5683 **/
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5684 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter2(
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5685 OrthancPluginContext* context,
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5686 OrthancPluginIncomingHttpRequestFilter2 callback)
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5687 {
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5688 _OrthancPluginIncomingHttpRequestFilter2 params;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5689 params.callback = callback;
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5690
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5691 return context->InvokeService(context, _OrthancPluginService_RegisterIncomingHttpRequestFilter2, &params);
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5692 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5693
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5694 #ifdef __cplusplus
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5695 }
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5696 #endif
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5697
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5698
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5699 /** @} */
c0cb5d2cd696 checks depending on Orthanc version
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5700