annotate Resources/Orthanc/Sdk-1.5.4/orthanc/OrthancCPlugin.h @ 308:6a668f5d1069

added warning comment
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 12 Jul 2021 17:22:53 +0200
parents d0b02fd48a92
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
123
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * \mainpage
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * This C/C++ SDK allows external developers to create plugins that
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 * can be loaded into Orthanc to extend its functionality. Each
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 * Orthanc plugin must expose 4 public functions with the following
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * signatures:
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * -# <tt>int32_t OrthancPluginInitialize(const OrthancPluginContext* context)</tt>:
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * This function is invoked by Orthanc when it loads the plugin on startup.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * The plugin must:
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * - Check its compatibility with the Orthanc version using
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * ::OrthancPluginCheckVersion().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * - Store the context pointer so that it can use the plugin
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * services of Orthanc.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * - Register all its REST callbacks using ::OrthancPluginRegisterRestCallback().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * - Possibly register its callback for received DICOM instances using ::OrthancPluginRegisterOnStoredInstanceCallback().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * - Possibly register its callback for changes to the DICOM store using ::OrthancPluginRegisterOnChangeCallback().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * - Possibly register a custom storage area using ::OrthancPluginRegisterStorageArea().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * - Possibly register a custom database back-end area using OrthancPluginRegisterDatabaseBackendV2().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 * - Possibly register a handler for C-Find SCP using OrthancPluginRegisterFindCallback().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 * - Possibly register a handler for C-Find SCP against DICOM worklists using OrthancPluginRegisterWorklistCallback().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 * - Possibly register a handler for C-Move SCP using OrthancPluginRegisterMoveCallback().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 * - Possibly register a custom decoder for DICOM images using OrthancPluginRegisterDecodeImageCallback().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 * - Possibly register a callback to filter incoming HTTP requests using OrthancPluginRegisterIncomingHttpRequestFilter2().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 * - Possibly register a callback to unserialize jobs using OrthancPluginRegisterJobsUnserializer().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 * - Possibly register a callback to refresh its metrics using OrthancPluginRegisterRefreshMetricsCallback().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 * -# <tt>void OrthancPluginFinalize()</tt>:
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 * This function is invoked by Orthanc during its shutdown. The plugin
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 * must free all its memory.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 * -# <tt>const char* OrthancPluginGetName()</tt>:
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 * The plugin must return a short string to identify itself.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 * -# <tt>const char* OrthancPluginGetVersion()</tt>:
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 * The plugin must return a string containing its version number.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 * The name and the version of a plugin is only used to prevent it
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 * from being loaded twice. Note that, in C++, it is mandatory to
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 * declare these functions within an <tt>extern "C"</tt> section.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 * To ensure multi-threading safety, the various REST callbacks are
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 * guaranteed to be executed in mutual exclusion since Orthanc
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 * 0.8.5. If this feature is undesired (notably when developing
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 * high-performance plugins handling simultaneous requests), use
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 * ::OrthancPluginRegisterRestCallbackNoLock().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 * @defgroup Images Images and compression
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 * @brief Functions to deal with images and compressed buffers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 * @defgroup REST REST
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 * @brief Functions to answer REST requests in a callback.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 * @defgroup Callbacks Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 * @brief Functions to register and manage callbacks by the plugins.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 * @defgroup DicomCallbacks DicomCallbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 * @brief Functions to register and manage DICOM callbacks (worklists, C-Find, C-MOVE).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 * @defgroup Orthanc Orthanc
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 * @brief Functions to access the content of the Orthanc server.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 * @defgroup Toolbox Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 * @brief Generic functions to help with the creation of plugins.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 * Orthanc - A Lightweight, RESTful DICOM Store
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 * Department, University Hospital of Liege, Belgium
149
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 140
diff changeset
79 * Copyright (C) 2017-2019 Osimis S.A., Belgium
123
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 * This program is free software: you can redistribute it and/or
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 * modify it under the terms of the GNU General Public License as
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 * published by the Free Software Foundation, either version 3 of the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 * License, or (at your option) any later version.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 * In addition, as a special exception, the copyright holders of this
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 * program give permission to link the code of its release with the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 * OpenSSL project's "OpenSSL" library (or with modified versions of it
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 * that use the same license as the "OpenSSL" library), and distribute
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 * the linked executables. You must obey the GNU General Public License
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 * in all respects for all of the code used other than "OpenSSL". If you
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 * modify file(s) with this exception, you may extend this exception to
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 * your version of the file(s), but you are not obligated to do so. If
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 * you do not wish to do so, delete this exception statement from your
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 * version. If you delete this exception statement from all source files
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 * in the program, then also delete it here.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 * This program is distributed in the hope that it will be useful, but
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 * WITHOUT ANY WARRANTY; without even the implied warranty of
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 * General Public License for more details.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 * You should have received a copy of the GNU General Public License
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 * along with this program. If not, see <http://www.gnu.org/licenses/>.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109 #pragma once
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 #include <stdio.h>
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 #include <string.h>
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 #ifdef WIN32
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 #define ORTHANC_PLUGINS_API __declspec(dllexport)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 #else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 #define ORTHANC_PLUGINS_API
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 #endif
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 #define ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER 1
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 #define ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER 5
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 #define ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER 4
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 #if !defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 #define ORTHANC_PLUGINS_VERSION_IS_ABOVE(major, minor, revision) \
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER > major || \
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER == major && \
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 (ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER > minor || \
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 (ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER == minor && \
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER >= revision))))
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 #endif
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 /********************************************************************
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 ** Check that function inlining is properly supported. The use of
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 ** inlining is required, to avoid the duplication of object code
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 ** between two compilation modules that would use the Orthanc Plugin
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 ** API.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 ********************************************************************/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 /* If the auto-detection of the "inline" keyword below does not work
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 automatically and that your compiler is known to properly support
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 inlining, uncomment the following #define and adapt the definition
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 of "static inline". */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 /* #define ORTHANC_PLUGIN_INLINE static inline */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 #ifndef ORTHANC_PLUGIN_INLINE
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 # if __STDC_VERSION__ >= 199901L
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 /* This is C99 or above: http://predef.sourceforge.net/prestd.html */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154 # define ORTHANC_PLUGIN_INLINE static inline
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 # elif defined(__cplusplus)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 /* This is C++ */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 # define ORTHANC_PLUGIN_INLINE static inline
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 # elif defined(__GNUC__)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 /* This is GCC running in C89 mode */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 # define ORTHANC_PLUGIN_INLINE static __inline
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 # elif defined(_MSC_VER)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 /* This is Visual Studio running in C89 mode */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 # define ORTHANC_PLUGIN_INLINE static __inline
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 # else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 # error Your compiler is not known to support the "inline" keyword
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166 # endif
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167 #endif
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171 /********************************************************************
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172 ** Inclusion of standard libraries.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
173 ********************************************************************/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
176 * For Microsoft Visual Studio, a compatibility "stdint.h" can be
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177 * downloaded at the following URL:
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
178 * https://orthanc.googlecode.com/hg/Resources/ThirdParty/VisualStudio/stdint.h
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
179 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
180 #include <stdint.h>
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182 #include <stdlib.h>
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
183
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
184
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
185
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
186 /********************************************************************
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187 ** Definition of the Orthanc Plugin API.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
188 ********************************************************************/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
189
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
190 /** @{ */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
191
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
192 #ifdef __cplusplus
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
193 extern "C"
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
194 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195 #endif
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
196
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
198 * The various error codes that can be returned by the Orthanc core.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
199 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200 typedef enum
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
201 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
202 OrthancPluginErrorCode_InternalError = -1 /*!< Internal error */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
203 OrthancPluginErrorCode_Success = 0 /*!< Success */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
204 OrthancPluginErrorCode_Plugin = 1 /*!< Error encountered within the plugin engine */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
205 OrthancPluginErrorCode_NotImplemented = 2 /*!< Not implemented yet */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
206 OrthancPluginErrorCode_ParameterOutOfRange = 3 /*!< Parameter out of range */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
207 OrthancPluginErrorCode_NotEnoughMemory = 4 /*!< The server hosting Orthanc is running out of memory */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
208 OrthancPluginErrorCode_BadParameterType = 5 /*!< Bad type for a parameter */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
209 OrthancPluginErrorCode_BadSequenceOfCalls = 6 /*!< Bad sequence of calls */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
210 OrthancPluginErrorCode_InexistentItem = 7 /*!< Accessing an inexistent item */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
211 OrthancPluginErrorCode_BadRequest = 8 /*!< Bad request */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
212 OrthancPluginErrorCode_NetworkProtocol = 9 /*!< Error in the network protocol */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
213 OrthancPluginErrorCode_SystemCommand = 10 /*!< Error while calling a system command */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
214 OrthancPluginErrorCode_Database = 11 /*!< Error with the database engine */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
215 OrthancPluginErrorCode_UriSyntax = 12 /*!< Badly formatted URI */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
216 OrthancPluginErrorCode_InexistentFile = 13 /*!< Inexistent file */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
217 OrthancPluginErrorCode_CannotWriteFile = 14 /*!< Cannot write to file */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
218 OrthancPluginErrorCode_BadFileFormat = 15 /*!< Bad file format */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
219 OrthancPluginErrorCode_Timeout = 16 /*!< Timeout */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
220 OrthancPluginErrorCode_UnknownResource = 17 /*!< Unknown resource */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
221 OrthancPluginErrorCode_IncompatibleDatabaseVersion = 18 /*!< Incompatible version of the database */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
222 OrthancPluginErrorCode_FullStorage = 19 /*!< The file storage is full */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
223 OrthancPluginErrorCode_CorruptedFile = 20 /*!< Corrupted file (e.g. inconsistent MD5 hash) */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
224 OrthancPluginErrorCode_InexistentTag = 21 /*!< Inexistent tag */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
225 OrthancPluginErrorCode_ReadOnly = 22 /*!< Cannot modify a read-only data structure */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
226 OrthancPluginErrorCode_IncompatibleImageFormat = 23 /*!< Incompatible format of the images */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
227 OrthancPluginErrorCode_IncompatibleImageSize = 24 /*!< Incompatible size of the images */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
228 OrthancPluginErrorCode_SharedLibrary = 25 /*!< Error while using a shared library (plugin) */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
229 OrthancPluginErrorCode_UnknownPluginService = 26 /*!< Plugin invoking an unknown service */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
230 OrthancPluginErrorCode_UnknownDicomTag = 27 /*!< Unknown DICOM tag */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
231 OrthancPluginErrorCode_BadJson = 28 /*!< Cannot parse a JSON document */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
232 OrthancPluginErrorCode_Unauthorized = 29 /*!< Bad credentials were provided to an HTTP request */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
233 OrthancPluginErrorCode_BadFont = 30 /*!< Badly formatted font file */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
234 OrthancPluginErrorCode_DatabasePlugin = 31 /*!< The plugin implementing a custom database back-end does not fulfill the proper interface */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
235 OrthancPluginErrorCode_StorageAreaPlugin = 32 /*!< Error in the plugin implementing a custom storage area */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
236 OrthancPluginErrorCode_EmptyRequest = 33 /*!< The request is empty */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
237 OrthancPluginErrorCode_NotAcceptable = 34 /*!< Cannot send a response which is acceptable according to the Accept HTTP header */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
238 OrthancPluginErrorCode_NullPointer = 35 /*!< Cannot handle a NULL pointer */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
239 OrthancPluginErrorCode_DatabaseUnavailable = 36 /*!< The database is currently not available (probably a transient situation) */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
240 OrthancPluginErrorCode_CanceledJob = 37 /*!< This job was canceled */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
241 OrthancPluginErrorCode_SQLiteNotOpened = 1000 /*!< SQLite: The database is not opened */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
242 OrthancPluginErrorCode_SQLiteAlreadyOpened = 1001 /*!< SQLite: Connection is already open */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
243 OrthancPluginErrorCode_SQLiteCannotOpen = 1002 /*!< SQLite: Unable to open the database */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
244 OrthancPluginErrorCode_SQLiteStatementAlreadyUsed = 1003 /*!< SQLite: This cached statement is already being referred to */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
245 OrthancPluginErrorCode_SQLiteExecute = 1004 /*!< SQLite: Cannot execute a command */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
246 OrthancPluginErrorCode_SQLiteRollbackWithoutTransaction = 1005 /*!< SQLite: Rolling back a nonexistent transaction (have you called Begin()?) */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
247 OrthancPluginErrorCode_SQLiteCommitWithoutTransaction = 1006 /*!< SQLite: Committing a nonexistent transaction */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
248 OrthancPluginErrorCode_SQLiteRegisterFunction = 1007 /*!< SQLite: Unable to register a function */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
249 OrthancPluginErrorCode_SQLiteFlush = 1008 /*!< SQLite: Unable to flush the database */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
250 OrthancPluginErrorCode_SQLiteCannotRun = 1009 /*!< SQLite: Cannot run a cached statement */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
251 OrthancPluginErrorCode_SQLiteCannotStep = 1010 /*!< SQLite: Cannot step over a cached statement */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
252 OrthancPluginErrorCode_SQLiteBindOutOfRange = 1011 /*!< SQLite: Bing a value while out of range (serious error) */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
253 OrthancPluginErrorCode_SQLitePrepareStatement = 1012 /*!< SQLite: Cannot prepare a cached statement */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
254 OrthancPluginErrorCode_SQLiteTransactionAlreadyStarted = 1013 /*!< SQLite: Beginning the same transaction twice */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
255 OrthancPluginErrorCode_SQLiteTransactionCommit = 1014 /*!< SQLite: Failure when committing the transaction */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
256 OrthancPluginErrorCode_SQLiteTransactionBegin = 1015 /*!< SQLite: Cannot start a transaction */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
257 OrthancPluginErrorCode_DirectoryOverFile = 2000 /*!< The directory to be created is already occupied by a regular file */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
258 OrthancPluginErrorCode_FileStorageCannotWrite = 2001 /*!< Unable to create a subdirectory or a file in the file storage */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
259 OrthancPluginErrorCode_DirectoryExpected = 2002 /*!< The specified path does not point to a directory */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
260 OrthancPluginErrorCode_HttpPortInUse = 2003 /*!< The TCP port of the HTTP server is privileged or already in use */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
261 OrthancPluginErrorCode_DicomPortInUse = 2004 /*!< The TCP port of the DICOM server is privileged or already in use */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
262 OrthancPluginErrorCode_BadHttpStatusInRest = 2005 /*!< This HTTP status is not allowed in a REST API */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
263 OrthancPluginErrorCode_RegularFileExpected = 2006 /*!< The specified path does not point to a regular file */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
264 OrthancPluginErrorCode_PathToExecutable = 2007 /*!< Unable to get the path to the executable */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
265 OrthancPluginErrorCode_MakeDirectory = 2008 /*!< Cannot create a directory */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
266 OrthancPluginErrorCode_BadApplicationEntityTitle = 2009 /*!< An application entity title (AET) cannot be empty or be longer than 16 characters */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
267 OrthancPluginErrorCode_NoCFindHandler = 2010 /*!< No request handler factory for DICOM C-FIND SCP */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
268 OrthancPluginErrorCode_NoCMoveHandler = 2011 /*!< No request handler factory for DICOM C-MOVE SCP */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
269 OrthancPluginErrorCode_NoCStoreHandler = 2012 /*!< No request handler factory for DICOM C-STORE SCP */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
270 OrthancPluginErrorCode_NoApplicationEntityFilter = 2013 /*!< No application entity filter */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
271 OrthancPluginErrorCode_NoSopClassOrInstance = 2014 /*!< DicomUserConnection: Unable to find the SOP class and instance */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
272 OrthancPluginErrorCode_NoPresentationContext = 2015 /*!< DicomUserConnection: No acceptable presentation context for modality */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
273 OrthancPluginErrorCode_DicomFindUnavailable = 2016 /*!< DicomUserConnection: The C-FIND command is not supported by the remote SCP */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
274 OrthancPluginErrorCode_DicomMoveUnavailable = 2017 /*!< DicomUserConnection: The C-MOVE command is not supported by the remote SCP */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
275 OrthancPluginErrorCode_CannotStoreInstance = 2018 /*!< Cannot store an instance */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
276 OrthancPluginErrorCode_CreateDicomNotString = 2019 /*!< Only string values are supported when creating DICOM instances */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
277 OrthancPluginErrorCode_CreateDicomOverrideTag = 2020 /*!< Trying to override a value inherited from a parent module */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
278 OrthancPluginErrorCode_CreateDicomUseContent = 2021 /*!< Use \"Content\" to inject an image into a new DICOM instance */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
279 OrthancPluginErrorCode_CreateDicomNoPayload = 2022 /*!< No payload is present for one instance in the series */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
280 OrthancPluginErrorCode_CreateDicomUseDataUriScheme = 2023 /*!< The payload of the DICOM instance must be specified according to Data URI scheme */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
281 OrthancPluginErrorCode_CreateDicomBadParent = 2024 /*!< Trying to attach a new DICOM instance to an inexistent resource */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
282 OrthancPluginErrorCode_CreateDicomParentIsInstance = 2025 /*!< Trying to attach a new DICOM instance to an instance (must be a series, study or patient) */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
283 OrthancPluginErrorCode_CreateDicomParentEncoding = 2026 /*!< Unable to get the encoding of the parent resource */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
284 OrthancPluginErrorCode_UnknownModality = 2027 /*!< Unknown modality */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
285 OrthancPluginErrorCode_BadJobOrdering = 2028 /*!< Bad ordering of filters in a job */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
286 OrthancPluginErrorCode_JsonToLuaTable = 2029 /*!< Cannot convert the given JSON object to a Lua table */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
287 OrthancPluginErrorCode_CannotCreateLua = 2030 /*!< Cannot create the Lua context */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
288 OrthancPluginErrorCode_CannotExecuteLua = 2031 /*!< Cannot execute a Lua command */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
289 OrthancPluginErrorCode_LuaAlreadyExecuted = 2032 /*!< Arguments cannot be pushed after the Lua function is executed */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
290 OrthancPluginErrorCode_LuaBadOutput = 2033 /*!< The Lua function does not give the expected number of outputs */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
291 OrthancPluginErrorCode_NotLuaPredicate = 2034 /*!< The Lua function is not a predicate (only true/false outputs allowed) */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
292 OrthancPluginErrorCode_LuaReturnsNoString = 2035 /*!< The Lua function does not return a string */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
293 OrthancPluginErrorCode_StorageAreaAlreadyRegistered = 2036 /*!< Another plugin has already registered a custom storage area */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
294 OrthancPluginErrorCode_DatabaseBackendAlreadyRegistered = 2037 /*!< Another plugin has already registered a custom database back-end */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
295 OrthancPluginErrorCode_DatabaseNotInitialized = 2038 /*!< Plugin trying to call the database during its initialization */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
296 OrthancPluginErrorCode_SslDisabled = 2039 /*!< Orthanc has been built without SSL support */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
297 OrthancPluginErrorCode_CannotOrderSlices = 2040 /*!< Unable to order the slices of the series */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
298 OrthancPluginErrorCode_NoWorklistHandler = 2041 /*!< No request handler factory for DICOM C-Find Modality SCP */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
299 OrthancPluginErrorCode_AlreadyExistingTag = 2042 /*!< Cannot override the value of a tag that already exists */,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
300
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
301 _OrthancPluginErrorCode_INTERNAL = 0x7fffffff
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
302 } OrthancPluginErrorCode;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
303
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
304
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
305 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
306 * Forward declaration of one of the mandatory functions for Orthanc
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
307 * plugins.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
308 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
309 ORTHANC_PLUGINS_API const char* OrthancPluginGetName();
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
310
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
311
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
312 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
313 * The various HTTP methods for a REST call.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
314 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
315 typedef enum
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
316 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
317 OrthancPluginHttpMethod_Get = 1, /*!< GET request */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
318 OrthancPluginHttpMethod_Post = 2, /*!< POST request */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
319 OrthancPluginHttpMethod_Put = 3, /*!< PUT request */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
320 OrthancPluginHttpMethod_Delete = 4, /*!< DELETE request */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
321
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
322 _OrthancPluginHttpMethod_INTERNAL = 0x7fffffff
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
323 } OrthancPluginHttpMethod;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
324
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
325
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
326 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
327 * @brief The parameters of a REST request.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
328 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
329 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
330 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
331 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
332 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
333 * @brief The HTTP method.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
334 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
335 OrthancPluginHttpMethod method;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
336
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
337 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
338 * @brief The number of groups of the regular expression.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
339 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
340 uint32_t groupsCount;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
341
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
342 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
343 * @brief The matched values for the groups of the regular expression.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
344 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
345 const char* const* groups;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
346
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
347 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
348 * @brief For a GET request, the number of GET parameters.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
349 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
350 uint32_t getCount;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
351
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
352 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
353 * @brief For a GET request, the keys of the GET parameters.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
354 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
355 const char* const* getKeys;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
356
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
357 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
358 * @brief For a GET request, the values of the GET parameters.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
359 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
360 const char* const* getValues;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
361
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
362 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
363 * @brief For a PUT or POST request, the content of the body.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
364 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
365 const char* body;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
366
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
367 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
368 * @brief For a PUT or POST request, the number of bytes of the body.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
369 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
370 uint32_t bodySize;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
371
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
372
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
373 /* --------------------------------------------------
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
374 New in version 0.8.1
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
375 -------------------------------------------------- */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
376
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
377 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
378 * @brief The number of HTTP headers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
379 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
380 uint32_t headersCount;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
381
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
382 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
383 * @brief The keys of the HTTP headers (always converted to low-case).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
384 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
385 const char* const* headersKeys;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
386
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
387 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
388 * @brief The values of the HTTP headers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
389 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
390 const char* const* headersValues;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
391
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
392 } OrthancPluginHttpRequest;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
393
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
394
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
395 typedef enum
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
396 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
397 /* Generic services */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
398 _OrthancPluginService_LogInfo = 1,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
399 _OrthancPluginService_LogWarning = 2,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
400 _OrthancPluginService_LogError = 3,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
401 _OrthancPluginService_GetOrthancPath = 4,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
402 _OrthancPluginService_GetOrthancDirectory = 5,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
403 _OrthancPluginService_GetConfigurationPath = 6,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
404 _OrthancPluginService_SetPluginProperty = 7,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
405 _OrthancPluginService_GetGlobalProperty = 8,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
406 _OrthancPluginService_SetGlobalProperty = 9,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
407 _OrthancPluginService_GetCommandLineArgumentsCount = 10,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
408 _OrthancPluginService_GetCommandLineArgument = 11,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
409 _OrthancPluginService_GetExpectedDatabaseVersion = 12,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
410 _OrthancPluginService_GetConfiguration = 13,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
411 _OrthancPluginService_BufferCompression = 14,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
412 _OrthancPluginService_ReadFile = 15,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
413 _OrthancPluginService_WriteFile = 16,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
414 _OrthancPluginService_GetErrorDescription = 17,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
415 _OrthancPluginService_CallHttpClient = 18,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
416 _OrthancPluginService_RegisterErrorCode = 19,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
417 _OrthancPluginService_RegisterDictionaryTag = 20,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
418 _OrthancPluginService_DicomBufferToJson = 21,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
419 _OrthancPluginService_DicomInstanceToJson = 22,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
420 _OrthancPluginService_CreateDicom = 23,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
421 _OrthancPluginService_ComputeMd5 = 24,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
422 _OrthancPluginService_ComputeSha1 = 25,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
423 _OrthancPluginService_LookupDictionary = 26,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
424 _OrthancPluginService_CallHttpClient2 = 27,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
425 _OrthancPluginService_GenerateUuid = 28,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
426 _OrthancPluginService_RegisterPrivateDictionaryTag = 29,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
427 _OrthancPluginService_AutodetectMimeType = 30,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
428 _OrthancPluginService_SetMetricsValue = 31,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
429 _OrthancPluginService_EncodeDicomWebJson = 32,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
430 _OrthancPluginService_EncodeDicomWebXml = 33,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
431
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
432 /* Registration of callbacks */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
433 _OrthancPluginService_RegisterRestCallback = 1000,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
434 _OrthancPluginService_RegisterOnStoredInstanceCallback = 1001,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
435 _OrthancPluginService_RegisterStorageArea = 1002,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
436 _OrthancPluginService_RegisterOnChangeCallback = 1003,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
437 _OrthancPluginService_RegisterRestCallbackNoLock = 1004,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
438 _OrthancPluginService_RegisterWorklistCallback = 1005,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
439 _OrthancPluginService_RegisterDecodeImageCallback = 1006,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
440 _OrthancPluginService_RegisterIncomingHttpRequestFilter = 1007,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
441 _OrthancPluginService_RegisterFindCallback = 1008,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
442 _OrthancPluginService_RegisterMoveCallback = 1009,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
443 _OrthancPluginService_RegisterIncomingHttpRequestFilter2 = 1010,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
444 _OrthancPluginService_RegisterRefreshMetricsCallback = 1011,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
445
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
446 /* Sending answers to REST calls */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
447 _OrthancPluginService_AnswerBuffer = 2000,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
448 _OrthancPluginService_CompressAndAnswerPngImage = 2001, /* Unused as of Orthanc 0.9.4 */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
449 _OrthancPluginService_Redirect = 2002,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
450 _OrthancPluginService_SendHttpStatusCode = 2003,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
451 _OrthancPluginService_SendUnauthorized = 2004,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
452 _OrthancPluginService_SendMethodNotAllowed = 2005,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
453 _OrthancPluginService_SetCookie = 2006,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
454 _OrthancPluginService_SetHttpHeader = 2007,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
455 _OrthancPluginService_StartMultipartAnswer = 2008,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
456 _OrthancPluginService_SendMultipartItem = 2009,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
457 _OrthancPluginService_SendHttpStatus = 2010,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
458 _OrthancPluginService_CompressAndAnswerImage = 2011,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
459 _OrthancPluginService_SendMultipartItem2 = 2012,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
460 _OrthancPluginService_SetHttpErrorDetails = 2013,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
461
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
462 /* Access to the Orthanc database and API */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
463 _OrthancPluginService_GetDicomForInstance = 3000,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
464 _OrthancPluginService_RestApiGet = 3001,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
465 _OrthancPluginService_RestApiPost = 3002,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
466 _OrthancPluginService_RestApiDelete = 3003,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
467 _OrthancPluginService_RestApiPut = 3004,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
468 _OrthancPluginService_LookupPatient = 3005,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
469 _OrthancPluginService_LookupStudy = 3006,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
470 _OrthancPluginService_LookupSeries = 3007,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
471 _OrthancPluginService_LookupInstance = 3008,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
472 _OrthancPluginService_LookupStudyWithAccessionNumber = 3009,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
473 _OrthancPluginService_RestApiGetAfterPlugins = 3010,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
474 _OrthancPluginService_RestApiPostAfterPlugins = 3011,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
475 _OrthancPluginService_RestApiDeleteAfterPlugins = 3012,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
476 _OrthancPluginService_RestApiPutAfterPlugins = 3013,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
477 _OrthancPluginService_ReconstructMainDicomTags = 3014,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
478 _OrthancPluginService_RestApiGet2 = 3015,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
479
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
480 /* Access to DICOM instances */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
481 _OrthancPluginService_GetInstanceRemoteAet = 4000,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
482 _OrthancPluginService_GetInstanceSize = 4001,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
483 _OrthancPluginService_GetInstanceData = 4002,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
484 _OrthancPluginService_GetInstanceJson = 4003,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
485 _OrthancPluginService_GetInstanceSimplifiedJson = 4004,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
486 _OrthancPluginService_HasInstanceMetadata = 4005,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
487 _OrthancPluginService_GetInstanceMetadata = 4006,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
488 _OrthancPluginService_GetInstanceOrigin = 4007,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
489
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
490 /* Services for plugins implementing a database back-end */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
491 _OrthancPluginService_RegisterDatabaseBackend = 5000,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
492 _OrthancPluginService_DatabaseAnswer = 5001,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
493 _OrthancPluginService_RegisterDatabaseBackendV2 = 5002,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
494 _OrthancPluginService_StorageAreaCreate = 5003,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
495 _OrthancPluginService_StorageAreaRead = 5004,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
496 _OrthancPluginService_StorageAreaRemove = 5005,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
497
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
498 /* Primitives for handling images */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
499 _OrthancPluginService_GetImagePixelFormat = 6000,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
500 _OrthancPluginService_GetImageWidth = 6001,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
501 _OrthancPluginService_GetImageHeight = 6002,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
502 _OrthancPluginService_GetImagePitch = 6003,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
503 _OrthancPluginService_GetImageBuffer = 6004,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
504 _OrthancPluginService_UncompressImage = 6005,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
505 _OrthancPluginService_FreeImage = 6006,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
506 _OrthancPluginService_CompressImage = 6007,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
507 _OrthancPluginService_ConvertPixelFormat = 6008,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
508 _OrthancPluginService_GetFontsCount = 6009,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
509 _OrthancPluginService_GetFontInfo = 6010,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
510 _OrthancPluginService_DrawText = 6011,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
511 _OrthancPluginService_CreateImage = 6012,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
512 _OrthancPluginService_CreateImageAccessor = 6013,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
513 _OrthancPluginService_DecodeDicomImage = 6014,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
514
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
515 /* Primitives for handling C-Find, C-Move and worklists */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
516 _OrthancPluginService_WorklistAddAnswer = 7000,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
517 _OrthancPluginService_WorklistMarkIncomplete = 7001,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
518 _OrthancPluginService_WorklistIsMatch = 7002,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
519 _OrthancPluginService_WorklistGetDicomQuery = 7003,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
520 _OrthancPluginService_FindAddAnswer = 7004,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
521 _OrthancPluginService_FindMarkIncomplete = 7005,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
522 _OrthancPluginService_GetFindQuerySize = 7006,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
523 _OrthancPluginService_GetFindQueryTag = 7007,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
524 _OrthancPluginService_GetFindQueryTagName = 7008,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
525 _OrthancPluginService_GetFindQueryValue = 7009,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
526 _OrthancPluginService_CreateFindMatcher = 7010,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
527 _OrthancPluginService_FreeFindMatcher = 7011,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
528 _OrthancPluginService_FindMatcherIsMatch = 7012,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
529
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
530 /* Primitives for accessing Orthanc Peers (new in 1.4.2) */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
531 _OrthancPluginService_GetPeers = 8000,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
532 _OrthancPluginService_FreePeers = 8001,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
533 _OrthancPluginService_GetPeersCount = 8003,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
534 _OrthancPluginService_GetPeerName = 8004,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
535 _OrthancPluginService_GetPeerUrl = 8005,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
536 _OrthancPluginService_CallPeerApi = 8006,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
537 _OrthancPluginService_GetPeerUserProperty = 8007,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
538
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
539 /* Primitives for handling jobs (new in 1.4.2) */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
540 _OrthancPluginService_CreateJob = 9000,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
541 _OrthancPluginService_FreeJob = 9001,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
542 _OrthancPluginService_SubmitJob = 9002,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
543 _OrthancPluginService_RegisterJobsUnserializer = 9003,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
544
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
545 _OrthancPluginService_INTERNAL = 0x7fffffff
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
546 } _OrthancPluginService;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
547
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
548
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
549 typedef enum
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
550 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
551 _OrthancPluginProperty_Description = 1,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
552 _OrthancPluginProperty_RootUri = 2,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
553 _OrthancPluginProperty_OrthancExplorer = 3,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
554
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
555 _OrthancPluginProperty_INTERNAL = 0x7fffffff
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
556 } _OrthancPluginProperty;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
557
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
558
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
559
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
560 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
561 * The memory layout of the pixels of an image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
562 * @ingroup Images
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
563 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
564 typedef enum
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
565 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
566 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
567 * @brief Graylevel 8bpp image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
568 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
569 * The image is graylevel. Each pixel is unsigned and stored in
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
570 * one byte.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
571 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
572 OrthancPluginPixelFormat_Grayscale8 = 1,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
573
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
574 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
575 * @brief Graylevel, unsigned 16bpp image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
576 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
577 * The image is graylevel. Each pixel is unsigned and stored in
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
578 * two bytes.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
579 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
580 OrthancPluginPixelFormat_Grayscale16 = 2,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
581
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
582 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
583 * @brief Graylevel, signed 16bpp image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
584 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
585 * The image is graylevel. Each pixel is signed and stored in two
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
586 * bytes.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
587 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
588 OrthancPluginPixelFormat_SignedGrayscale16 = 3,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
589
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
590 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
591 * @brief Color image in RGB24 format.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
592 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
593 * This format describes a color image. The pixels are stored in 3
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
594 * consecutive bytes. The memory layout is RGB.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
595 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
596 OrthancPluginPixelFormat_RGB24 = 4,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
597
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
598 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
599 * @brief Color image in RGBA32 format.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
600 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
601 * This format describes a color image. The pixels are stored in 4
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
602 * consecutive bytes. The memory layout is RGBA.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
603 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
604 OrthancPluginPixelFormat_RGBA32 = 5,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
605
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
606 OrthancPluginPixelFormat_Unknown = 6, /*!< Unknown pixel format */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
607
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
608 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
609 * @brief Color image in RGB48 format.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
610 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
611 * This format describes a color image. The pixels are stored in 6
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
612 * consecutive bytes. The memory layout is RRGGBB.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
613 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
614 OrthancPluginPixelFormat_RGB48 = 7,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
615
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
616 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
617 * @brief Graylevel, unsigned 32bpp image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
618 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
619 * The image is graylevel. Each pixel is unsigned and stored in
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
620 * four bytes.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
621 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
622 OrthancPluginPixelFormat_Grayscale32 = 8,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
623
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
624 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
625 * @brief Graylevel, floating-point 32bpp image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
626 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
627 * The image is graylevel. Each pixel is floating-point and stored
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
628 * in four bytes.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
629 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
630 OrthancPluginPixelFormat_Float32 = 9,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
631
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
632 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
633 * @brief Color image in BGRA32 format.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
634 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
635 * This format describes a color image. The pixels are stored in 4
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
636 * consecutive bytes. The memory layout is BGRA.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
637 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
638 OrthancPluginPixelFormat_BGRA32 = 10,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
639
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
640 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
641 * @brief Graylevel, unsigned 64bpp image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
642 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
643 * The image is graylevel. Each pixel is unsigned and stored in
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
644 * eight bytes.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
645 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
646 OrthancPluginPixelFormat_Grayscale64 = 11,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
647
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
648 _OrthancPluginPixelFormat_INTERNAL = 0x7fffffff
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
649 } OrthancPluginPixelFormat;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
650
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
651
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
652
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
653 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
654 * The content types that are supported by Orthanc plugins.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
655 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
656 typedef enum
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
657 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
658 OrthancPluginContentType_Unknown = 0, /*!< Unknown content type */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
659 OrthancPluginContentType_Dicom = 1, /*!< DICOM */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
660 OrthancPluginContentType_DicomAsJson = 2, /*!< JSON summary of a DICOM file */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
661
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
662 _OrthancPluginContentType_INTERNAL = 0x7fffffff
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
663 } OrthancPluginContentType;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
664
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
665
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
666
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
667 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
668 * The supported types of DICOM resources.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
669 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
670 typedef enum
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
671 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
672 OrthancPluginResourceType_Patient = 0, /*!< Patient */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
673 OrthancPluginResourceType_Study = 1, /*!< Study */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
674 OrthancPluginResourceType_Series = 2, /*!< Series */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
675 OrthancPluginResourceType_Instance = 3, /*!< Instance */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
676 OrthancPluginResourceType_None = 4, /*!< Unavailable resource type */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
677
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
678 _OrthancPluginResourceType_INTERNAL = 0x7fffffff
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
679 } OrthancPluginResourceType;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
680
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
681
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
682
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
683 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
684 * The supported types of changes that can happen to DICOM resources.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
685 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
686 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
687 typedef enum
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
688 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
689 OrthancPluginChangeType_CompletedSeries = 0, /*!< Series is now complete */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
690 OrthancPluginChangeType_Deleted = 1, /*!< Deleted resource */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
691 OrthancPluginChangeType_NewChildInstance = 2, /*!< A new instance was added to this resource */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
692 OrthancPluginChangeType_NewInstance = 3, /*!< New instance received */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
693 OrthancPluginChangeType_NewPatient = 4, /*!< New patient created */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
694 OrthancPluginChangeType_NewSeries = 5, /*!< New series created */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
695 OrthancPluginChangeType_NewStudy = 6, /*!< New study created */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
696 OrthancPluginChangeType_StablePatient = 7, /*!< Timeout: No new instance in this patient */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
697 OrthancPluginChangeType_StableSeries = 8, /*!< Timeout: No new instance in this series */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
698 OrthancPluginChangeType_StableStudy = 9, /*!< Timeout: No new instance in this study */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
699 OrthancPluginChangeType_OrthancStarted = 10, /*!< Orthanc has started */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
700 OrthancPluginChangeType_OrthancStopped = 11, /*!< Orthanc is stopping */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
701 OrthancPluginChangeType_UpdatedAttachment = 12, /*!< Some user-defined attachment has changed for this resource */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
702 OrthancPluginChangeType_UpdatedMetadata = 13, /*!< Some user-defined metadata has changed for this resource */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
703 OrthancPluginChangeType_UpdatedPeers = 14, /*!< The list of Orthanc peers has changed */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
704 OrthancPluginChangeType_UpdatedModalities = 15, /*!< The list of DICOM modalities has changed */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
705
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
706 _OrthancPluginChangeType_INTERNAL = 0x7fffffff
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
707 } OrthancPluginChangeType;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
708
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
709
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
710 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
711 * The compression algorithms that are supported by the Orthanc core.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
712 * @ingroup Images
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
713 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
714 typedef enum
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
715 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
716 OrthancPluginCompressionType_Zlib = 0, /*!< Standard zlib compression */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
717 OrthancPluginCompressionType_ZlibWithSize = 1, /*!< zlib, prefixed with uncompressed size (uint64_t) */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
718 OrthancPluginCompressionType_Gzip = 2, /*!< Standard gzip compression */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
719 OrthancPluginCompressionType_GzipWithSize = 3, /*!< gzip, prefixed with uncompressed size (uint64_t) */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
720
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
721 _OrthancPluginCompressionType_INTERNAL = 0x7fffffff
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
722 } OrthancPluginCompressionType;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
723
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
724
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
725 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
726 * The image formats that are supported by the Orthanc core.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
727 * @ingroup Images
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
728 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
729 typedef enum
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
730 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
731 OrthancPluginImageFormat_Png = 0, /*!< Image compressed using PNG */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
732 OrthancPluginImageFormat_Jpeg = 1, /*!< Image compressed using JPEG */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
733 OrthancPluginImageFormat_Dicom = 2, /*!< Image compressed using DICOM */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
734
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
735 _OrthancPluginImageFormat_INTERNAL = 0x7fffffff
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
736 } OrthancPluginImageFormat;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
737
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
738
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
739 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
740 * The value representations present in the DICOM standard (version 2013).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
741 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
742 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
743 typedef enum
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
744 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
745 OrthancPluginValueRepresentation_AE = 1, /*!< Application Entity */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
746 OrthancPluginValueRepresentation_AS = 2, /*!< Age String */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
747 OrthancPluginValueRepresentation_AT = 3, /*!< Attribute Tag */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
748 OrthancPluginValueRepresentation_CS = 4, /*!< Code String */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
749 OrthancPluginValueRepresentation_DA = 5, /*!< Date */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
750 OrthancPluginValueRepresentation_DS = 6, /*!< Decimal String */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
751 OrthancPluginValueRepresentation_DT = 7, /*!< Date Time */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
752 OrthancPluginValueRepresentation_FD = 8, /*!< Floating Point Double */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
753 OrthancPluginValueRepresentation_FL = 9, /*!< Floating Point Single */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
754 OrthancPluginValueRepresentation_IS = 10, /*!< Integer String */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
755 OrthancPluginValueRepresentation_LO = 11, /*!< Long String */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
756 OrthancPluginValueRepresentation_LT = 12, /*!< Long Text */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
757 OrthancPluginValueRepresentation_OB = 13, /*!< Other Byte String */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
758 OrthancPluginValueRepresentation_OF = 14, /*!< Other Float String */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
759 OrthancPluginValueRepresentation_OW = 15, /*!< Other Word String */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
760 OrthancPluginValueRepresentation_PN = 16, /*!< Person Name */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
761 OrthancPluginValueRepresentation_SH = 17, /*!< Short String */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
762 OrthancPluginValueRepresentation_SL = 18, /*!< Signed Long */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
763 OrthancPluginValueRepresentation_SQ = 19, /*!< Sequence of Items */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
764 OrthancPluginValueRepresentation_SS = 20, /*!< Signed Short */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
765 OrthancPluginValueRepresentation_ST = 21, /*!< Short Text */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
766 OrthancPluginValueRepresentation_TM = 22, /*!< Time */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
767 OrthancPluginValueRepresentation_UI = 23, /*!< Unique Identifier (UID) */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
768 OrthancPluginValueRepresentation_UL = 24, /*!< Unsigned Long */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
769 OrthancPluginValueRepresentation_UN = 25, /*!< Unknown */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
770 OrthancPluginValueRepresentation_US = 26, /*!< Unsigned Short */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
771 OrthancPluginValueRepresentation_UT = 27, /*!< Unlimited Text */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
772
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
773 _OrthancPluginValueRepresentation_INTERNAL = 0x7fffffff
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
774 } OrthancPluginValueRepresentation;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
775
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
776
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
777 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
778 * The possible output formats for a DICOM-to-JSON conversion.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
779 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
780 * @see OrthancPluginDicomToJson()
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
781 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
782 typedef enum
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
783 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
784 OrthancPluginDicomToJsonFormat_Full = 1, /*!< Full output, with most details */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
785 OrthancPluginDicomToJsonFormat_Short = 2, /*!< Tags output as hexadecimal numbers */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
786 OrthancPluginDicomToJsonFormat_Human = 3, /*!< Human-readable JSON */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
787
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
788 _OrthancPluginDicomToJsonFormat_INTERNAL = 0x7fffffff
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
789 } OrthancPluginDicomToJsonFormat;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
790
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
791
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
792 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
793 * Flags to customize a DICOM-to-JSON conversion. By default, binary
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
794 * tags are formatted using Data URI scheme.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
795 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
796 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
797 typedef enum
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
798 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
799 OrthancPluginDicomToJsonFlags_None = 0,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
800 OrthancPluginDicomToJsonFlags_IncludeBinary = (1 << 0), /*!< Include the binary tags */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
801 OrthancPluginDicomToJsonFlags_IncludePrivateTags = (1 << 1), /*!< Include the private tags */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
802 OrthancPluginDicomToJsonFlags_IncludeUnknownTags = (1 << 2), /*!< Include the tags unknown by the dictionary */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
803 OrthancPluginDicomToJsonFlags_IncludePixelData = (1 << 3), /*!< Include the pixel data */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
804 OrthancPluginDicomToJsonFlags_ConvertBinaryToAscii = (1 << 4), /*!< Output binary tags as-is, dropping non-ASCII */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
805 OrthancPluginDicomToJsonFlags_ConvertBinaryToNull = (1 << 5), /*!< Signal binary tags as null values */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
806
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
807 _OrthancPluginDicomToJsonFlags_INTERNAL = 0x7fffffff
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
808 } OrthancPluginDicomToJsonFlags;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
809
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
810
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
811 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
812 * Flags to the creation of a DICOM file.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
813 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
814 * @see OrthancPluginCreateDicom()
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
815 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
816 typedef enum
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
817 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
818 OrthancPluginCreateDicomFlags_None = 0,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
819 OrthancPluginCreateDicomFlags_DecodeDataUriScheme = (1 << 0), /*!< Decode fields encoded using data URI scheme */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
820 OrthancPluginCreateDicomFlags_GenerateIdentifiers = (1 << 1), /*!< Automatically generate DICOM identifiers */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
821
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
822 _OrthancPluginCreateDicomFlags_INTERNAL = 0x7fffffff
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
823 } OrthancPluginCreateDicomFlags;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
824
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
825
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
826 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
827 * The constraints on the DICOM identifiers that must be supported
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
828 * by the database plugins.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
829 * @deprecated Plugins using OrthancPluginConstraintType will be faster
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
830 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
831 typedef enum
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
832 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
833 OrthancPluginIdentifierConstraint_Equal = 1, /*!< Equal */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
834 OrthancPluginIdentifierConstraint_SmallerOrEqual = 2, /*!< Less or equal */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
835 OrthancPluginIdentifierConstraint_GreaterOrEqual = 3, /*!< More or equal */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
836 OrthancPluginIdentifierConstraint_Wildcard = 4, /*!< Case-sensitive wildcard matching (with * and ?) */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
837
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
838 _OrthancPluginIdentifierConstraint_INTERNAL = 0x7fffffff
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
839 } OrthancPluginIdentifierConstraint;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
840
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
841
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
842 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
843 * The constraints on the tags (main DICOM tags and identifier tags)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
844 * that must be supported by the database plugins.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
845 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
846 typedef enum
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
847 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
848 OrthancPluginConstraintType_Equal = 1, /*!< Equal */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
849 OrthancPluginConstraintType_SmallerOrEqual = 2, /*!< Less or equal */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
850 OrthancPluginConstraintType_GreaterOrEqual = 3, /*!< More or equal */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
851 OrthancPluginConstraintType_Wildcard = 4, /*!< Wildcard matching */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
852 OrthancPluginConstraintType_List = 5, /*!< List of values */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
853
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
854 _OrthancPluginConstraintType_INTERNAL = 0x7fffffff
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
855 } OrthancPluginConstraintType;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
856
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
857
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
858 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
859 * The origin of a DICOM instance that has been received by Orthanc.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
860 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
861 typedef enum
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
862 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
863 OrthancPluginInstanceOrigin_Unknown = 1, /*!< Unknown origin */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
864 OrthancPluginInstanceOrigin_DicomProtocol = 2, /*!< Instance received through DICOM protocol */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
865 OrthancPluginInstanceOrigin_RestApi = 3, /*!< Instance received through REST API of Orthanc */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
866 OrthancPluginInstanceOrigin_Plugin = 4, /*!< Instance added to Orthanc by a plugin */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
867 OrthancPluginInstanceOrigin_Lua = 5, /*!< Instance added to Orthanc by a Lua script */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
868
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
869 _OrthancPluginInstanceOrigin_INTERNAL = 0x7fffffff
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
870 } OrthancPluginInstanceOrigin;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
871
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
872
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
873 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
874 * The possible status for one single step of a job.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
875 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
876 typedef enum
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
877 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
878 OrthancPluginJobStepStatus_Success = 1, /*!< The job has successfully executed all its steps */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
879 OrthancPluginJobStepStatus_Failure = 2, /*!< The job has failed while executing this step */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
880 OrthancPluginJobStepStatus_Continue = 3 /*!< The job has still data to process after this step */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
881 } OrthancPluginJobStepStatus;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
882
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
883
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
884 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
885 * Explains why the job should stop and release the resources it has
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
886 * allocated. This is especially important to disambiguate between
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
887 * the "paused" condition and the "final" conditions (success,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
888 * failure, or canceled).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
889 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
890 typedef enum
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
891 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
892 OrthancPluginJobStopReason_Success = 1, /*!< The job has succeeded */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
893 OrthancPluginJobStopReason_Paused = 2, /*!< The job was paused, and will be resumed later */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
894 OrthancPluginJobStopReason_Failure = 3, /*!< The job has failed, and might be resubmitted later */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
895 OrthancPluginJobStopReason_Canceled = 4 /*!< The job was canceled, and might be resubmitted later */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
896 } OrthancPluginJobStopReason;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
897
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
898
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
899 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
900 * The available types of metrics.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
901 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
902 typedef enum
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
903 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
904 OrthancPluginMetricsType_Default, /*!< Default metrics */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
905
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
906 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
907 * This metrics represents a time duration. Orthanc will keep the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
908 * maximum value of the metrics over a sliding window of ten
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
909 * seconds, which is useful if the metrics is sampled frequently.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
910 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
911 OrthancPluginMetricsType_Timer
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
912 } OrthancPluginMetricsType;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
913
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
914
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
915 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
916 * The available modes to export a binary DICOM tag into a DICOMweb
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
917 * JSON or XML document.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
918 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
919 typedef enum
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
920 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
921 OrthancPluginDicomWebBinaryMode_Ignore, /*!< Don't include binary tags */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
922 OrthancPluginDicomWebBinaryMode_InlineBinary, /*!< Inline encoding using Base64 */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
923 OrthancPluginDicomWebBinaryMode_BulkDataUri /*!< Use a bulk data URI field */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
924 } OrthancPluginDicomWebBinaryMode;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
925
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
926
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
927
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
928 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
929 * @brief A memory buffer allocated by the core system of Orthanc.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
930 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
931 * A memory buffer allocated by the core system of Orthanc. When the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
932 * content of the buffer is not useful anymore, it must be free by a
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
933 * call to ::OrthancPluginFreeMemoryBuffer().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
934 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
935 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
936 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
937 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
938 * @brief The content of the buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
939 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
940 void* data;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
941
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
942 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
943 * @brief The number of bytes in the buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
944 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
945 uint32_t size;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
946 } OrthancPluginMemoryBuffer;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
947
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
948
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
949
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
950
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
951 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
952 * @brief Opaque structure that represents the HTTP connection to the client application.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
953 * @ingroup Callback
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
954 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
955 typedef struct _OrthancPluginRestOutput_t OrthancPluginRestOutput;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
956
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
957
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
958
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
959 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
960 * @brief Opaque structure that represents a DICOM instance received by Orthanc.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
961 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
962 typedef struct _OrthancPluginDicomInstance_t OrthancPluginDicomInstance;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
963
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
964
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
965
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
966 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
967 * @brief Opaque structure that represents an image that is uncompressed in memory.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
968 * @ingroup Images
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
969 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
970 typedef struct _OrthancPluginImage_t OrthancPluginImage;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
971
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
972
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
973
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
974 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
975 * @brief Opaque structure that represents the storage area that is actually used by Orthanc.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
976 * @ingroup Images
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
977 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
978 typedef struct _OrthancPluginStorageArea_t OrthancPluginStorageArea;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
979
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
980
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
981
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
982 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
983 * @brief Opaque structure to an object that represents a C-Find query for worklists.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
984 * @ingroup DicomCallbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
985 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
986 typedef struct _OrthancPluginWorklistQuery_t OrthancPluginWorklistQuery;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
987
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
988
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
989
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
990 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
991 * @brief Opaque structure to an object that represents the answers to a C-Find query for worklists.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
992 * @ingroup DicomCallbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
993 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
994 typedef struct _OrthancPluginWorklistAnswers_t OrthancPluginWorklistAnswers;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
995
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
996
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
997
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
998 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
999 * @brief Opaque structure to an object that represents a C-Find query.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1000 * @ingroup DicomCallbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1001 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1002 typedef struct _OrthancPluginFindQuery_t OrthancPluginFindQuery;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1003
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1004
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1005
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1006 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1007 * @brief Opaque structure to an object that represents the answers to a C-Find query for worklists.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1008 * @ingroup DicomCallbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1009 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1010 typedef struct _OrthancPluginFindAnswers_t OrthancPluginFindAnswers;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1011
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1012
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1013
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1014 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1015 * @brief Opaque structure to an object that can be used to check whether a DICOM instance matches a C-Find query.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1016 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1017 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1018 typedef struct _OrthancPluginFindAnswers_t OrthancPluginFindMatcher;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1019
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1020
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1021
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1022 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1023 * @brief Opaque structure to the set of remote Orthanc Peers that are known to the local Orthanc server.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1024 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1025 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1026 typedef struct _OrthancPluginPeers_t OrthancPluginPeers;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1027
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1028
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1029
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1030 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1031 * @brief Opaque structure to a job to be executed by Orthanc.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1032 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1033 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1034 typedef struct _OrthancPluginJob_t OrthancPluginJob;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1035
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1036
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1037
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1038 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1039 * @brief Opaque structure that represents a node in a JSON or XML
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1040 * document used in DICOMweb.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1041 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1042 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1043 typedef struct _OrthancPluginDicomWebNode_t OrthancPluginDicomWebNode;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1044
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1045
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1046
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1047 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1048 * @brief Signature of a callback function that answers to a REST request.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1049 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1050 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1051 typedef OrthancPluginErrorCode (*OrthancPluginRestCallback) (
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1052 OrthancPluginRestOutput* output,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1053 const char* url,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1054 const OrthancPluginHttpRequest* request);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1055
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1056
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1057
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1058 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1059 * @brief Signature of a callback function that is triggered when Orthanc receives a DICOM instance.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1060 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1061 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1062 typedef OrthancPluginErrorCode (*OrthancPluginOnStoredInstanceCallback) (
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1063 OrthancPluginDicomInstance* instance,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1064 const char* instanceId);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1065
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1066
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1067
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1068 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1069 * @brief Signature of a callback function that is triggered when a change happens to some DICOM resource.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1070 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1071 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1072 typedef OrthancPluginErrorCode (*OrthancPluginOnChangeCallback) (
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1073 OrthancPluginChangeType changeType,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1074 OrthancPluginResourceType resourceType,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1075 const char* resourceId);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1076
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1077
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1078
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1079 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1080 * @brief Signature of a callback function to decode a DICOM instance as an image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1081 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1082 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1083 typedef OrthancPluginErrorCode (*OrthancPluginDecodeImageCallback) (
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1084 OrthancPluginImage** target,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1085 const void* dicom,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1086 const uint32_t size,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1087 uint32_t frameIndex);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1088
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1089
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1090
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1091 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1092 * @brief Signature of a function to free dynamic memory.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1093 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1094 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1095 typedef void (*OrthancPluginFree) (void* buffer);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1096
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1097
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1098
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1099 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1100 * @brief Signature of a function to set the content of a node
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1101 * encoding a binary DICOM tag, into a JSON or XML document
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1102 * generated for DICOMweb.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1103 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1104 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1105 typedef void (*OrthancPluginDicomWebSetBinaryNode) (
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1106 OrthancPluginDicomWebNode* node,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1107 OrthancPluginDicomWebBinaryMode mode,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1108 const char* bulkDataUri);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1109
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1110
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1111
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1112 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1113 * @brief Callback for writing to the storage area.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1114 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1115 * Signature of a callback function that is triggered when Orthanc writes a file to the storage area.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1116 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1117 * @param uuid The UUID of the file.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1118 * @param content The content of the file.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1119 * @param size The size of the file.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1120 * @param type The content type corresponding to this file.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1121 * @return 0 if success, other value if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1122 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1123 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1124 typedef OrthancPluginErrorCode (*OrthancPluginStorageCreate) (
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1125 const char* uuid,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1126 const void* content,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1127 int64_t size,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1128 OrthancPluginContentType type);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1129
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1130
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1131
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1132 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1133 * @brief Callback for reading from the storage area.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1134 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1135 * Signature of a callback function that is triggered when Orthanc reads a file from the storage area.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1136 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1137 * @param content The content of the file (output).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1138 * @param size The size of the file (output).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1139 * @param uuid The UUID of the file of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1140 * @param type The content type corresponding to this file.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1141 * @return 0 if success, other value if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1142 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1143 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1144 typedef OrthancPluginErrorCode (*OrthancPluginStorageRead) (
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1145 void** content,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1146 int64_t* size,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1147 const char* uuid,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1148 OrthancPluginContentType type);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1149
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1150
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1151
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1152 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1153 * @brief Callback for removing a file from the storage area.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1154 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1155 * Signature of a callback function that is triggered when Orthanc deletes a file from the storage area.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1156 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1157 * @param uuid The UUID of the file to be removed.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1158 * @param type The content type corresponding to this file.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1159 * @return 0 if success, other value if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1160 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1161 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1162 typedef OrthancPluginErrorCode (*OrthancPluginStorageRemove) (
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1163 const char* uuid,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1164 OrthancPluginContentType type);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1165
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1166
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1167
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1168 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1169 * @brief Callback to handle the C-Find SCP requests for worklists.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1170 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1171 * Signature of a callback function that is triggered when Orthanc
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1172 * receives a C-Find SCP request against modality worklists.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1173 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1174 * @param answers The target structure where answers must be stored.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1175 * @param query The worklist query.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1176 * @param issuerAet The Application Entity Title (AET) of the modality from which the request originates.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1177 * @param calledAet The Application Entity Title (AET) of the modality that is called by the request.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1178 * @return 0 if success, other value if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1179 * @ingroup DicomCallbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1180 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1181 typedef OrthancPluginErrorCode (*OrthancPluginWorklistCallback) (
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1182 OrthancPluginWorklistAnswers* answers,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1183 const OrthancPluginWorklistQuery* query,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1184 const char* issuerAet,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1185 const char* calledAet);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1186
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1187
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1188
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1189 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1190 * @brief Callback to filter incoming HTTP requests received by Orthanc.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1191 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1192 * Signature of a callback function that is triggered whenever
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1193 * Orthanc receives an HTTP/REST request, and that answers whether
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1194 * this request should be allowed. If the callback returns "0"
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1195 * ("false"), the server answers with HTTP status code 403
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1196 * (Forbidden).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1197 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1198 * @param method The HTTP method used by the request.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1199 * @param uri The URI of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1200 * @param ip The IP address of the HTTP client.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1201 * @param headersCount The number of HTTP headers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1202 * @param headersKeys The keys of the HTTP headers (always converted to low-case).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1203 * @param headersValues The values of the HTTP headers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1204 * @return 0 if forbidden access, 1 if allowed access, -1 if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1205 * @ingroup Callback
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1206 * @deprecated Please instead use OrthancPluginIncomingHttpRequestFilter2()
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1207 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1208 typedef int32_t (*OrthancPluginIncomingHttpRequestFilter) (
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1209 OrthancPluginHttpMethod method,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1210 const char* uri,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1211 const char* ip,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1212 uint32_t headersCount,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1213 const char* const* headersKeys,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1214 const char* const* headersValues);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1215
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1216
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1217
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1218 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1219 * @brief Callback to filter incoming HTTP requests received by Orthanc.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1220 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1221 * Signature of a callback function that is triggered whenever
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1222 * Orthanc receives an HTTP/REST request, and that answers whether
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1223 * this request should be allowed. If the callback returns "0"
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1224 * ("false"), the server answers with HTTP status code 403
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1225 * (Forbidden).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1226 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1227 * @param method The HTTP method used by the request.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1228 * @param uri The URI of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1229 * @param ip The IP address of the HTTP client.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1230 * @param headersCount The number of HTTP headers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1231 * @param headersKeys The keys of the HTTP headers (always converted to low-case).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1232 * @param headersValues The values of the HTTP headers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1233 * @param getArgumentsCount The number of GET arguments (only for the GET HTTP method).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1234 * @param getArgumentsKeys The keys of the GET arguments (only for the GET HTTP method).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1235 * @param getArgumentsValues The values of the GET arguments (only for the GET HTTP method).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1236 * @return 0 if forbidden access, 1 if allowed access, -1 if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1237 * @ingroup Callback
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1238 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1239 typedef int32_t (*OrthancPluginIncomingHttpRequestFilter2) (
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1240 OrthancPluginHttpMethod method,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1241 const char* uri,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1242 const char* ip,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1243 uint32_t headersCount,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1244 const char* const* headersKeys,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1245 const char* const* headersValues,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1246 uint32_t getArgumentsCount,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1247 const char* const* getArgumentsKeys,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1248 const char* const* getArgumentsValues);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1249
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1250
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1251
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1252 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1253 * @brief Callback to handle incoming C-Find SCP requests.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1254 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1255 * Signature of a callback function that is triggered whenever
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1256 * Orthanc receives a C-Find SCP request not concerning modality
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1257 * worklists.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1258 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1259 * @param answers The target structure where answers must be stored.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1260 * @param query The worklist query.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1261 * @param issuerAet The Application Entity Title (AET) of the modality from which the request originates.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1262 * @param calledAet The Application Entity Title (AET) of the modality that is called by the request.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1263 * @return 0 if success, other value if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1264 * @ingroup DicomCallbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1265 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1266 typedef OrthancPluginErrorCode (*OrthancPluginFindCallback) (
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1267 OrthancPluginFindAnswers* answers,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1268 const OrthancPluginFindQuery* query,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1269 const char* issuerAet,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1270 const char* calledAet);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1271
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1272
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1273
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1274 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1275 * @brief Callback to handle incoming C-Move SCP requests.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1276 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1277 * Signature of a callback function that is triggered whenever
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1278 * Orthanc receives a C-Move SCP request. The callback receives the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1279 * type of the resource of interest (study, series, instance...)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1280 * together with the DICOM tags containing its identifiers. In turn,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1281 * the plugin must create a driver object that will be responsible
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1282 * for driving the successive move suboperations.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1283 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1284 * @param resourceType The type of the resource of interest. Note
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1285 * that this might be set to ResourceType_None if the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1286 * QueryRetrieveLevel (0008,0052) tag was not provided by the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1287 * issuer (i.e. the originator modality).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1288 * @param patientId Content of the PatientID (0x0010, 0x0020) tag of the resource of interest. Might be NULL.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1289 * @param accessionNumber Content of the AccessionNumber (0x0008, 0x0050) tag. Might be NULL.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1290 * @param studyInstanceUid Content of the StudyInstanceUID (0x0020, 0x000d) tag. Might be NULL.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1291 * @param seriesInstanceUid Content of the SeriesInstanceUID (0x0020, 0x000e) tag. Might be NULL.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1292 * @param sopInstanceUid Content of the SOPInstanceUID (0x0008, 0x0018) tag. Might be NULL.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1293 * @param originatorAet The Application Entity Title (AET) of the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1294 * modality from which the request originates.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1295 * @param sourceAet The Application Entity Title (AET) of the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1296 * modality that should send its DICOM files to another modality.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1297 * @param targetAet The Application Entity Title (AET) of the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1298 * modality that should receive the DICOM files.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1299 * @param originatorId The Message ID issued by the originator modality,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1300 * as found in tag (0000,0110) of the DICOM query emitted by the issuer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1301 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1302 * @return The NULL value if the plugin cannot deal with this query,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1303 * or a pointer to the driver object that is responsible for
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1304 * handling the successive move suboperations.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1305 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1306 * @note If targetAet equals sourceAet, this is actually a query/retrieve operation.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1307 * @ingroup DicomCallbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1308 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1309 typedef void* (*OrthancPluginMoveCallback) (
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1310 OrthancPluginResourceType resourceType,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1311 const char* patientId,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1312 const char* accessionNumber,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1313 const char* studyInstanceUid,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1314 const char* seriesInstanceUid,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1315 const char* sopInstanceUid,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1316 const char* originatorAet,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1317 const char* sourceAet,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1318 const char* targetAet,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1319 uint16_t originatorId);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1320
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1321
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1322 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1323 * @brief Callback to read the size of a C-Move driver.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1324 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1325 * Signature of a callback function that returns the number of
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1326 * C-Move suboperations that are to be achieved by the given C-Move
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1327 * driver. This driver is the return value of a previous call to the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1328 * OrthancPluginMoveCallback() callback.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1329 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1330 * @param moveDriver The C-Move driver of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1331 * @return The number of suboperations.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1332 * @ingroup DicomCallbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1333 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1334 typedef uint32_t (*OrthancPluginGetMoveSize) (void* moveDriver);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1335
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1336
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1337 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1338 * @brief Callback to apply one C-Move suboperation.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1339 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1340 * Signature of a callback function that applies the next C-Move
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1341 * suboperation that os to be achieved by the given C-Move
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1342 * driver. This driver is the return value of a previous call to the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1343 * OrthancPluginMoveCallback() callback.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1344 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1345 * @param moveDriver The C-Move driver of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1346 * @return 0 if success, or the error code if failure.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1347 * @ingroup DicomCallbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1348 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1349 typedef OrthancPluginErrorCode (*OrthancPluginApplyMove) (void* moveDriver);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1350
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1351
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1352 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1353 * @brief Callback to free one C-Move driver.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1354 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1355 * Signature of a callback function that releases the resources
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1356 * allocated by the given C-Move driver. This driver is the return
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1357 * value of a previous call to the OrthancPluginMoveCallback()
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1358 * callback.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1359 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1360 * @param moveDriver The C-Move driver of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1361 * @ingroup DicomCallbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1362 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1363 typedef void (*OrthancPluginFreeMove) (void* moveDriver);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1364
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1365
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1366 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1367 * @brief Callback to finalize one custom job.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1368 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1369 * Signature of a callback function that releases all the resources
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1370 * allocated by the given job. This job is the argument provided to
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1371 * OrthancPluginCreateJob().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1372 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1373 * @param job The job of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1374 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1375 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1376 typedef void (*OrthancPluginJobFinalize) (void* job);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1377
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1378
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1379 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1380 * @brief Callback to check the progress of one custom job.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1381 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1382 * Signature of a callback function that returns the progress of the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1383 * job.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1384 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1385 * @param job The job of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1386 * @return The progress, as a floating-point number ranging from 0 to 1.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1387 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1388 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1389 typedef float (*OrthancPluginJobGetProgress) (void* job);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1390
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1391
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1392 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1393 * @brief Callback to retrieve the content of one custom job.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1394 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1395 * Signature of a callback function that returns human-readable
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1396 * statistics about the job. This statistics must be formatted as a
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1397 * JSON object. This information is notably displayed in the "Jobs"
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1398 * tab of "Orthanc Explorer".
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1399 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1400 * @param job The job of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1401 * @return The statistics, as a JSON object encoded as a string.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1402 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1403 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1404 typedef const char* (*OrthancPluginJobGetContent) (void* job);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1405
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1406
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1407 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1408 * @brief Callback to serialize one custom job.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1409 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1410 * Signature of a callback function that returns a serialized
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1411 * version of the job, formatted as a JSON object. This
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1412 * serialization is stored in the Orthanc database, and is used to
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1413 * reload the job on the restart of Orthanc. The "unserialization"
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1414 * callback (with OrthancPluginJobsUnserializer signature) will
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1415 * receive this serialized object.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1416 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1417 * @param job The job of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1418 * @return The serialized job, as a JSON object encoded as a string.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1419 * @see OrthancPluginRegisterJobsUnserializer()
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1420 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1421 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1422 typedef const char* (*OrthancPluginJobGetSerialized) (void* job);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1423
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1424
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1425 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1426 * @brief Callback to execute one step of a custom job.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1427 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1428 * Signature of a callback function that executes one step in the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1429 * job. The jobs engine of Orthanc will make successive calls to
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1430 * this method, as long as it returns
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1431 * OrthancPluginJobStepStatus_Continue.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1432 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1433 * @param job The job of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1434 * @return The status of execution.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1435 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1436 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1437 typedef OrthancPluginJobStepStatus (*OrthancPluginJobStep) (void* job);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1438
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1439
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1440 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1441 * @brief Callback executed once one custom job leaves the "running" state.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1442 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1443 * Signature of a callback function that is invoked once a job
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1444 * leaves the "running" state. This can happen if the previous call
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1445 * to OrthancPluginJobStep has failed/succeeded, if the host Orthanc
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1446 * server is being stopped, or if the user manually tags the job as
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1447 * paused/canceled. This callback allows the plugin to free
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1448 * resources allocated for running this custom job (e.g. to stop
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1449 * threads, or to remove temporary files).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1450 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1451 * Note that handling pauses might involves a specific treatment
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1452 * (such a stopping threads, but keeping temporary files on the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1453 * disk). This "paused" situation can be checked by looking at the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1454 * "reason" parameter.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1455 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1456 * @param job The job of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1457 * @param reason The reason for leaving the "running" state.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1458 * @return 0 if success, or the error code if failure.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1459 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1460 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1461 typedef OrthancPluginErrorCode (*OrthancPluginJobStop) (void* job,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1462 OrthancPluginJobStopReason reason);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1463
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1464
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1465 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1466 * @brief Callback executed once one stopped custom job is started again.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1467 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1468 * Signature of a callback function that is invoked once a job
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1469 * leaves the "failure/canceled" state, to be started again. This
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1470 * function will typically reset the progress to zero. Note that
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1471 * before being actually executed, the job would first be tagged as
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1472 * "pending" in the Orthanc jobs engine.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1473 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1474 * @param job The job of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1475 * @return 0 if success, or the error code if failure.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1476 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1477 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1478 typedef OrthancPluginErrorCode (*OrthancPluginJobReset) (void* job);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1479
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1480
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1481 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1482 * @brief Callback executed to unserialize a custom job.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1483 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1484 * Signature of a callback function that unserializes a job that was
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1485 * saved in the Orthanc database.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1486 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1487 * @param jobType The type of the job, as provided to OrthancPluginCreateJob().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1488 * @param serialized The serialization of the job, as provided by OrthancPluginJobGetSerialized.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1489 * @return The unserialized job (as created by OrthancPluginCreateJob()), or NULL
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1490 * if this unserializer cannot handle this job type.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1491 * @see OrthancPluginRegisterJobsUnserializer()
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1492 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1493 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1494 typedef OrthancPluginJob* (*OrthancPluginJobsUnserializer) (const char* jobType,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1495 const char* serialized);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1496
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1497
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1498
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1499 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1500 * @brief Callback executed to update the metrics of the plugin.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1501 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1502 * Signature of a callback function that is called by Orthanc
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1503 * whenever a monitoring tool (such as Prometheus) asks the current
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1504 * values of the metrics. This callback gives the plugin a chance to
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1505 * update its metrics, by calling OrthancPluginSetMetricsValue().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1506 * This is typically useful for metrics that are expensive to
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1507 * acquire.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1508 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1509 * @see OrthancPluginRegisterRefreshMetrics()
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1510 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1511 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1512 typedef void (*OrthancPluginRefreshMetricsCallback) ();
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1513
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1514
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1515
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1516 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1517 * @brief Callback executed to encode a binary tag in DICOMweb.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1518 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1519 * Signature of a callback function that is called by Orthanc
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1520 * whenever a DICOM tag that contains a binary value must be written
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1521 * to a JSON or XML node, while a DICOMweb document is being
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1522 * generated. The value representation (VR) of the DICOM tag can be
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1523 * OB, OD, OF, OL, OW, or UN.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1524 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1525 * @see OrthancPluginEncodeDicomWebJson() and OrthancPluginEncodeDicomWebXml()
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1526 * @param node The node being generated, as provided by Orthanc.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1527 * @param setter The setter to be used to encode the content of the node. If
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1528 * the setter is not called, the binary tag is not written to the output document.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1529 * @param levelDepth The depth of the node in the DICOM hierarchy of sequences.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1530 * This parameter gives the number of elements in the "levelTagGroup",
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1531 * "levelTagElement", and "levelIndex" arrays.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1532 * @param levelTagGroup The group of the parent DICOM tags in the hierarchy.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1533 * @param levelTagElement The element of the parent DICOM tags in the hierarchy.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1534 * @param levelIndex The index of the node in the parent sequences of the hiearchy.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1535 * @param tagGroup The group of the DICOM tag of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1536 * @param tagElement The element of the DICOM tag of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1537 * @param vr The value representation of the binary DICOM node.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1538 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1539 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1540 typedef void (*OrthancPluginDicomWebBinaryCallback) (
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1541 OrthancPluginDicomWebNode* node,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1542 OrthancPluginDicomWebSetBinaryNode setter,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1543 uint32_t levelDepth,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1544 const uint16_t* levelTagGroup,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1545 const uint16_t* levelTagElement,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1546 const uint32_t* levelIndex,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1547 uint16_t tagGroup,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1548 uint16_t tagElement,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1549 OrthancPluginValueRepresentation vr);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1550
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1551
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1552
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1553 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1554 * @brief Data structure that contains information about the Orthanc core.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1555 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1556 typedef struct _OrthancPluginContext_t
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1557 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1558 void* pluginsManager;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1559 const char* orthancVersion;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1560 OrthancPluginFree Free;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1561 OrthancPluginErrorCode (*InvokeService) (struct _OrthancPluginContext_t* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1562 _OrthancPluginService service,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1563 const void* params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1564 } OrthancPluginContext;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1565
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1566
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1567
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1568 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1569 * @brief An entry in the dictionary of DICOM tags.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1570 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1571 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1572 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1573 uint16_t group; /*!< The group of the tag */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1574 uint16_t element; /*!< The element of the tag */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1575 OrthancPluginValueRepresentation vr; /*!< The value representation of the tag */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1576 uint32_t minMultiplicity; /*!< The minimum multiplicity of the tag */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1577 uint32_t maxMultiplicity; /*!< The maximum multiplicity of the tag (0 means arbitrary) */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1578 } OrthancPluginDictionaryEntry;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1579
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1580
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1581
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1582 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1583 * @brief Free a string.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1584 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1585 * Free a string that was allocated by the core system of Orthanc.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1586 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1587 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1588 * @param str The string to be freed.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1589 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1590 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeString(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1591 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1592 char* str)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1593 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1594 if (str != NULL)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1595 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1596 context->Free(str);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1597 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1598 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1599
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1600
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1601 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1602 * @brief Check that the version of the hosting Orthanc is above a given version.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1603 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1604 * This function checks whether the version of the Orthanc server
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1605 * running this plugin, is above the given version. Contrarily to
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1606 * OrthancPluginCheckVersion(), it is up to the developer of the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1607 * plugin to make sure that all the Orthanc SDK services called by
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1608 * the plugin are actually implemented in the given version of
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1609 * Orthanc.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1610 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1611 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1612 * @param expectedMajor Expected major version.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1613 * @param expectedMinor Expected minor version.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1614 * @param expectedRevision Expected revision.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1615 * @return 1 if and only if the versions are compatible. If the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1616 * result is 0, the initialization of the plugin should fail.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1617 * @see OrthancPluginCheckVersion
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1618 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1619 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1620 ORTHANC_PLUGIN_INLINE int OrthancPluginCheckVersionAdvanced(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1621 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1622 int expectedMajor,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1623 int expectedMinor,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1624 int expectedRevision)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1625 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1626 int major, minor, revision;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1627
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1628 if (sizeof(int32_t) != sizeof(OrthancPluginErrorCode) ||
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1629 sizeof(int32_t) != sizeof(OrthancPluginHttpMethod) ||
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1630 sizeof(int32_t) != sizeof(_OrthancPluginService) ||
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1631 sizeof(int32_t) != sizeof(_OrthancPluginProperty) ||
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1632 sizeof(int32_t) != sizeof(OrthancPluginPixelFormat) ||
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1633 sizeof(int32_t) != sizeof(OrthancPluginContentType) ||
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1634 sizeof(int32_t) != sizeof(OrthancPluginResourceType) ||
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1635 sizeof(int32_t) != sizeof(OrthancPluginChangeType) ||
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1636 sizeof(int32_t) != sizeof(OrthancPluginCompressionType) ||
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1637 sizeof(int32_t) != sizeof(OrthancPluginImageFormat) ||
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1638 sizeof(int32_t) != sizeof(OrthancPluginValueRepresentation) ||
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1639 sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFormat) ||
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1640 sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFlags) ||
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1641 sizeof(int32_t) != sizeof(OrthancPluginCreateDicomFlags) ||
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1642 sizeof(int32_t) != sizeof(OrthancPluginIdentifierConstraint) ||
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1643 sizeof(int32_t) != sizeof(OrthancPluginInstanceOrigin) ||
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1644 sizeof(int32_t) != sizeof(OrthancPluginJobStepStatus) ||
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1645 sizeof(int32_t) != sizeof(OrthancPluginConstraintType) ||
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1646 sizeof(int32_t) != sizeof(OrthancPluginMetricsType) ||
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1647 sizeof(int32_t) != sizeof(OrthancPluginDicomWebBinaryMode))
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1648 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1649 /* Mismatch in the size of the enumerations */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1650 return 0;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1651 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1652
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1653 /* Assume compatibility with the mainline */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1654 if (!strcmp(context->orthancVersion, "mainline"))
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1655 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1656 return 1;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1657 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1658
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1659 /* Parse the version of the Orthanc core */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1660 if (
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1661 #ifdef _MSC_VER
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1662 sscanf_s
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1663 #else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1664 sscanf
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1665 #endif
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1666 (context->orthancVersion, "%4d.%4d.%4d", &major, &minor, &revision) != 3)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1667 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1668 return 0;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1669 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1670
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1671 /* Check the major number of the version */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1672
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1673 if (major > expectedMajor)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1674 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1675 return 1;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1676 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1677
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1678 if (major < expectedMajor)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1679 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1680 return 0;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1681 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1682
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1683 /* Check the minor number of the version */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1684
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1685 if (minor > expectedMinor)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1686 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1687 return 1;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1688 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1689
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1690 if (minor < expectedMinor)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1691 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1692 return 0;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1693 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1694
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1695 /* Check the revision number of the version */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1696
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1697 if (revision >= expectedRevision)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1698 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1699 return 1;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1700 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1701 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1702 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1703 return 0;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1704 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1705 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1706
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1707
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1708 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1709 * @brief Check the compatibility of the plugin wrt. the version of its hosting Orthanc.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1710 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1711 * This function checks whether the version of the Orthanc server
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1712 * running this plugin, is above the version of the current Orthanc
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1713 * SDK header. This guarantees that the plugin is compatible with
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1714 * the hosting Orthanc (i.e. it will not call unavailable services).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1715 * The result of this function should always be checked in the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1716 * OrthancPluginInitialize() entry point of the plugin.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1717 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1718 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1719 * @return 1 if and only if the versions are compatible. If the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1720 * result is 0, the initialization of the plugin should fail.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1721 * @see OrthancPluginCheckVersionAdvanced
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1722 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1723 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1724 ORTHANC_PLUGIN_INLINE int OrthancPluginCheckVersion(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1725 OrthancPluginContext* context)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1726 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1727 return OrthancPluginCheckVersionAdvanced(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1728 context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1729 ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1730 ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1731 ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1732 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1733
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1734
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1735 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1736 * @brief Free a memory buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1737 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1738 * Free a memory buffer that was allocated by the core system of Orthanc.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1739 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1740 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1741 * @param buffer The memory buffer to release.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1742 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1743 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeMemoryBuffer(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1744 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1745 OrthancPluginMemoryBuffer* buffer)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1746 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1747 context->Free(buffer->data);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1748 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1749
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1750
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1751 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1752 * @brief Log an error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1753 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1754 * Log an error message using the Orthanc logging system.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1755 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1756 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1757 * @param message The message to be logged.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1758 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1759 ORTHANC_PLUGIN_INLINE void OrthancPluginLogError(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1760 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1761 const char* message)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1762 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1763 context->InvokeService(context, _OrthancPluginService_LogError, message);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1764 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1765
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1766
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1767 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1768 * @brief Log a warning.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1769 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1770 * Log a warning message using the Orthanc logging system.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1771 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1772 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1773 * @param message The message to be logged.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1774 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1775 ORTHANC_PLUGIN_INLINE void OrthancPluginLogWarning(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1776 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1777 const char* message)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1778 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1779 context->InvokeService(context, _OrthancPluginService_LogWarning, message);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1780 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1781
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1782
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1783 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1784 * @brief Log an information.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1785 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1786 * Log an information message using the Orthanc logging system.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1787 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1788 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1789 * @param message The message to be logged.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1790 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1791 ORTHANC_PLUGIN_INLINE void OrthancPluginLogInfo(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1792 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1793 const char* message)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1794 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1795 context->InvokeService(context, _OrthancPluginService_LogInfo, message);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1796 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1797
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1798
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1799
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1800 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1801 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1802 const char* pathRegularExpression;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1803 OrthancPluginRestCallback callback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1804 } _OrthancPluginRestCallback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1805
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1806 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1807 * @brief Register a REST callback.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1808 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1809 * This function registers a REST callback against a regular
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1810 * expression for a URI. This function must be called during the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1811 * initialization of the plugin, i.e. inside the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1812 * OrthancPluginInitialize() public function.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1813 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1814 * Each REST callback is guaranteed to run in mutual exclusion.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1815 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1816 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1817 * @param pathRegularExpression Regular expression for the URI. May contain groups.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1818 * @param callback The callback function to handle the REST call.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1819 * @see OrthancPluginRegisterRestCallbackNoLock()
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1820 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1821 * @note
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1822 * The regular expression is case sensitive and must follow the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1823 * [Perl syntax](https://www.boost.org/doc/libs/1_67_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1824 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1825 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1826 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1827 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallback(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1828 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1829 const char* pathRegularExpression,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1830 OrthancPluginRestCallback callback)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1831 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1832 _OrthancPluginRestCallback params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1833 params.pathRegularExpression = pathRegularExpression;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1834 params.callback = callback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1835 context->InvokeService(context, _OrthancPluginService_RegisterRestCallback, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1836 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1837
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1838
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1839
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1840 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1841 * @brief Register a REST callback, without locking.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1842 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1843 * This function registers a REST callback against a regular
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1844 * expression for a URI. This function must be called during the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1845 * initialization of the plugin, i.e. inside the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1846 * OrthancPluginInitialize() public function.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1847 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1848 * Contrarily to OrthancPluginRegisterRestCallback(), the callback
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1849 * will NOT be invoked in mutual exclusion. This can be useful for
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1850 * high-performance plugins that must handle concurrent requests
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1851 * (Orthanc uses a pool of threads, one thread being assigned to
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1852 * each incoming HTTP request). Of course, if using this function,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1853 * it is up to the plugin to implement the required locking
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1854 * mechanisms.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1855 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1856 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1857 * @param pathRegularExpression Regular expression for the URI. May contain groups.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1858 * @param callback The callback function to handle the REST call.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1859 * @see OrthancPluginRegisterRestCallback()
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1860 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1861 * @note
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1862 * The regular expression is case sensitive and must follow the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1863 * [Perl syntax](https://www.boost.org/doc/libs/1_67_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1864 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1865 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1866 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1867 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallbackNoLock(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1868 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1869 const char* pathRegularExpression,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1870 OrthancPluginRestCallback callback)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1871 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1872 _OrthancPluginRestCallback params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1873 params.pathRegularExpression = pathRegularExpression;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1874 params.callback = callback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1875 context->InvokeService(context, _OrthancPluginService_RegisterRestCallbackNoLock, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1876 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1877
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1878
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1879
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1880 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1881 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1882 OrthancPluginOnStoredInstanceCallback callback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1883 } _OrthancPluginOnStoredInstanceCallback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1884
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1885 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1886 * @brief Register a callback for received instances.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1887 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1888 * This function registers a callback function that is called
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1889 * whenever a new DICOM instance is stored into the Orthanc core.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1890 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1891 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1892 * @param callback The callback function.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1893 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1894 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1895 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnStoredInstanceCallback(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1896 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1897 OrthancPluginOnStoredInstanceCallback callback)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1898 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1899 _OrthancPluginOnStoredInstanceCallback params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1900 params.callback = callback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1901
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1902 context->InvokeService(context, _OrthancPluginService_RegisterOnStoredInstanceCallback, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1903 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1904
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1905
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1906
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1907 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1908 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1909 OrthancPluginRestOutput* output;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1910 const char* answer;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1911 uint32_t answerSize;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1912 const char* mimeType;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1913 } _OrthancPluginAnswerBuffer;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1914
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1915 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1916 * @brief Answer to a REST request.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1917 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1918 * This function answers to a REST request with the content of a memory buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1919 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1920 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1921 * @param output The HTTP connection to the client application.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1922 * @param answer Pointer to the memory buffer containing the answer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1923 * @param answerSize Number of bytes of the answer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1924 * @param mimeType The MIME type of the answer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1925 * @ingroup REST
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1926 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1927 ORTHANC_PLUGIN_INLINE void OrthancPluginAnswerBuffer(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1928 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1929 OrthancPluginRestOutput* output,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1930 const char* answer,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1931 uint32_t answerSize,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1932 const char* mimeType)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1933 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1934 _OrthancPluginAnswerBuffer params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1935 params.output = output;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1936 params.answer = answer;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1937 params.answerSize = answerSize;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1938 params.mimeType = mimeType;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1939 context->InvokeService(context, _OrthancPluginService_AnswerBuffer, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1940 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1941
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1942
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1943 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1944 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1945 OrthancPluginRestOutput* output;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1946 OrthancPluginPixelFormat format;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1947 uint32_t width;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1948 uint32_t height;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1949 uint32_t pitch;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1950 const void* buffer;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1951 } _OrthancPluginCompressAndAnswerPngImage;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1952
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1953 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1954 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1955 OrthancPluginRestOutput* output;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1956 OrthancPluginImageFormat imageFormat;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1957 OrthancPluginPixelFormat pixelFormat;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1958 uint32_t width;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1959 uint32_t height;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1960 uint32_t pitch;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1961 const void* buffer;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1962 uint8_t quality;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1963 } _OrthancPluginCompressAndAnswerImage;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1964
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1965
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1966 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1967 * @brief Answer to a REST request with a PNG image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1968 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1969 * This function answers to a REST request with a PNG image. The
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1970 * parameters of this function describe a memory buffer that
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1971 * contains an uncompressed image. The image will be automatically compressed
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1972 * as a PNG image by the core system of Orthanc.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1973 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1974 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1975 * @param output The HTTP connection to the client application.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1976 * @param format The memory layout of the uncompressed image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1977 * @param width The width of the image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1978 * @param height The height of the image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1979 * @param pitch The pitch of the image (i.e. the number of bytes
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1980 * between 2 successive lines of the image in the memory buffer).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1981 * @param buffer The memory buffer containing the uncompressed image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1982 * @ingroup REST
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1983 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1984 ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerPngImage(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1985 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1986 OrthancPluginRestOutput* output,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1987 OrthancPluginPixelFormat format,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1988 uint32_t width,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1989 uint32_t height,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1990 uint32_t pitch,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1991 const void* buffer)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1992 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1993 _OrthancPluginCompressAndAnswerImage params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1994 params.output = output;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1995 params.imageFormat = OrthancPluginImageFormat_Png;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1996 params.pixelFormat = format;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1997 params.width = width;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1998 params.height = height;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1999 params.pitch = pitch;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2000 params.buffer = buffer;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2001 params.quality = 0; /* No quality for PNG */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2002 context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2003 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2004
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2005
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2006
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2007 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2008 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2009 OrthancPluginMemoryBuffer* target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2010 const char* instanceId;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2011 } _OrthancPluginGetDicomForInstance;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2012
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2013 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2014 * @brief Retrieve a DICOM instance using its Orthanc identifier.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2015 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2016 * Retrieve a DICOM instance using its Orthanc identifier. The DICOM
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2017 * file is stored into a newly allocated memory buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2018 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2019 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2020 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2021 * @param instanceId The Orthanc identifier of the DICOM instance of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2022 * @return 0 if success, or the error code if failure.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2023 * @ingroup Orthanc
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2024 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2025 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginGetDicomForInstance(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2026 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2027 OrthancPluginMemoryBuffer* target,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2028 const char* instanceId)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2029 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2030 _OrthancPluginGetDicomForInstance params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2031 params.target = target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2032 params.instanceId = instanceId;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2033 return context->InvokeService(context, _OrthancPluginService_GetDicomForInstance, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2034 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2035
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2036
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2037
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2038 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2039 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2040 OrthancPluginMemoryBuffer* target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2041 const char* uri;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2042 } _OrthancPluginRestApiGet;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2043
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2044 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2045 * @brief Make a GET call to the built-in Orthanc REST API.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2046 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2047 * Make a GET call to the built-in Orthanc REST API. The result to
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2048 * the query is stored into a newly allocated memory buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2049 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2050 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2051 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2052 * @param uri The URI in the built-in Orthanc API.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2053 * @return 0 if success, or the error code if failure.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2054 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2055 * @see OrthancPluginRestApiGetAfterPlugins
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2056 * @ingroup Orthanc
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2057 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2058 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGet(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2059 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2060 OrthancPluginMemoryBuffer* target,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2061 const char* uri)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2062 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2063 _OrthancPluginRestApiGet params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2064 params.target = target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2065 params.uri = uri;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2066 return context->InvokeService(context, _OrthancPluginService_RestApiGet, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2067 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2068
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2069
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2070
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2071 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2072 * @brief Make a GET call to the REST API, as tainted by the plugins.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2073 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2074 * Make a GET call to the Orthanc REST API, after all the plugins
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2075 * are applied. In other words, if some plugin overrides or adds the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2076 * called URI to the built-in Orthanc REST API, this call will
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2077 * return the result provided by this plugin. The result to the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2078 * query is stored into a newly allocated memory buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2079 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2080 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2081 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2082 * @param uri The URI in the built-in Orthanc API.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2083 * @return 0 if success, or the error code if failure.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2084 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2085 * @see OrthancPluginRestApiGet
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2086 * @ingroup Orthanc
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2087 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2088 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGetAfterPlugins(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2089 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2090 OrthancPluginMemoryBuffer* target,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2091 const char* uri)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2092 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2093 _OrthancPluginRestApiGet params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2094 params.target = target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2095 params.uri = uri;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2096 return context->InvokeService(context, _OrthancPluginService_RestApiGetAfterPlugins, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2097 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2098
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2099
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2100
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2101 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2102 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2103 OrthancPluginMemoryBuffer* target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2104 const char* uri;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2105 const char* body;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2106 uint32_t bodySize;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2107 } _OrthancPluginRestApiPostPut;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2108
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2109 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2110 * @brief Make a POST call to the built-in Orthanc REST API.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2111 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2112 * Make a POST call to the built-in Orthanc REST API. The result to
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2113 * the query is stored into a newly allocated memory buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2114 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2115 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2116 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2117 * @param uri The URI in the built-in Orthanc API.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2118 * @param body The body of the POST request.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2119 * @param bodySize The size of the body.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2120 * @return 0 if success, or the error code if failure.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2121 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2122 * @see OrthancPluginRestApiPostAfterPlugins
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2123 * @ingroup Orthanc
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2124 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2125 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPost(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2126 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2127 OrthancPluginMemoryBuffer* target,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2128 const char* uri,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2129 const char* body,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2130 uint32_t bodySize)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2131 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2132 _OrthancPluginRestApiPostPut params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2133 params.target = target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2134 params.uri = uri;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2135 params.body = body;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2136 params.bodySize = bodySize;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2137 return context->InvokeService(context, _OrthancPluginService_RestApiPost, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2138 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2139
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2140
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2141 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2142 * @brief Make a POST call to the REST API, as tainted by the plugins.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2143 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2144 * Make a POST call to the Orthanc REST API, after all the plugins
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2145 * are applied. In other words, if some plugin overrides or adds the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2146 * called URI to the built-in Orthanc REST API, this call will
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2147 * return the result provided by this plugin. The result to the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2148 * query is stored into a newly allocated memory buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2149 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2150 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2151 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2152 * @param uri The URI in the built-in Orthanc API.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2153 * @param body The body of the POST request.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2154 * @param bodySize The size of the body.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2155 * @return 0 if success, or the error code if failure.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2156 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2157 * @see OrthancPluginRestApiPost
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2158 * @ingroup Orthanc
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2159 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2160 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPostAfterPlugins(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2161 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2162 OrthancPluginMemoryBuffer* target,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2163 const char* uri,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2164 const char* body,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2165 uint32_t bodySize)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2166 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2167 _OrthancPluginRestApiPostPut params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2168 params.target = target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2169 params.uri = uri;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2170 params.body = body;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2171 params.bodySize = bodySize;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2172 return context->InvokeService(context, _OrthancPluginService_RestApiPostAfterPlugins, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2173 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2174
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2175
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2176
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2177 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2178 * @brief Make a DELETE call to the built-in Orthanc REST API.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2179 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2180 * Make a DELETE call to the built-in Orthanc REST API.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2181 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2182 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2183 * @param uri The URI to delete in the built-in Orthanc API.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2184 * @return 0 if success, or the error code if failure.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2185 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2186 * @see OrthancPluginRestApiDeleteAfterPlugins
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2187 * @ingroup Orthanc
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2188 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2189 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiDelete(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2190 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2191 const char* uri)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2192 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2193 return context->InvokeService(context, _OrthancPluginService_RestApiDelete, uri);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2194 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2195
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2196
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2197 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2198 * @brief Make a DELETE call to the REST API, as tainted by the plugins.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2199 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2200 * Make a DELETE call to the Orthanc REST API, after all the plugins
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2201 * are applied. In other words, if some plugin overrides or adds the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2202 * called URI to the built-in Orthanc REST API, this call will
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2203 * return the result provided by this plugin.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2204 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2205 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2206 * @param uri The URI to delete in the built-in Orthanc API.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2207 * @return 0 if success, or the error code if failure.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2208 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2209 * @see OrthancPluginRestApiDelete
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2210 * @ingroup Orthanc
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2211 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2212 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiDeleteAfterPlugins(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2213 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2214 const char* uri)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2215 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2216 return context->InvokeService(context, _OrthancPluginService_RestApiDeleteAfterPlugins, uri);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2217 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2218
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2219
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2220
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2221 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2222 * @brief Make a PUT call to the built-in Orthanc REST API.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2223 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2224 * Make a PUT call to the built-in Orthanc REST API. The result to
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2225 * the query is stored into a newly allocated memory buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2226 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2227 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2228 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2229 * @param uri The URI in the built-in Orthanc API.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2230 * @param body The body of the PUT request.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2231 * @param bodySize The size of the body.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2232 * @return 0 if success, or the error code if failure.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2233 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2234 * @see OrthancPluginRestApiPutAfterPlugins
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2235 * @ingroup Orthanc
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2236 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2237 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPut(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2238 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2239 OrthancPluginMemoryBuffer* target,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2240 const char* uri,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2241 const char* body,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2242 uint32_t bodySize)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2243 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2244 _OrthancPluginRestApiPostPut params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2245 params.target = target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2246 params.uri = uri;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2247 params.body = body;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2248 params.bodySize = bodySize;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2249 return context->InvokeService(context, _OrthancPluginService_RestApiPut, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2250 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2251
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2252
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2253
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2254 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2255 * @brief Make a PUT call to the REST API, as tainted by the plugins.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2256 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2257 * Make a PUT call to the Orthanc REST API, after all the plugins
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2258 * are applied. In other words, if some plugin overrides or adds the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2259 * called URI to the built-in Orthanc REST API, this call will
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2260 * return the result provided by this plugin. The result to the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2261 * query is stored into a newly allocated memory buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2262 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2263 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2264 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2265 * @param uri The URI in the built-in Orthanc API.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2266 * @param body The body of the PUT request.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2267 * @param bodySize The size of the body.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2268 * @return 0 if success, or the error code if failure.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2269 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2270 * @see OrthancPluginRestApiPut
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2271 * @ingroup Orthanc
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2272 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2273 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPutAfterPlugins(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2274 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2275 OrthancPluginMemoryBuffer* target,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2276 const char* uri,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2277 const char* body,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2278 uint32_t bodySize)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2279 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2280 _OrthancPluginRestApiPostPut params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2281 params.target = target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2282 params.uri = uri;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2283 params.body = body;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2284 params.bodySize = bodySize;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2285 return context->InvokeService(context, _OrthancPluginService_RestApiPutAfterPlugins, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2286 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2287
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2288
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2289
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2290 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2291 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2292 OrthancPluginRestOutput* output;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2293 const char* argument;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2294 } _OrthancPluginOutputPlusArgument;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2295
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2296 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2297 * @brief Redirect a REST request.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2298 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2299 * This function answers to a REST request by redirecting the user
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2300 * to another URI using HTTP status 301.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2301 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2302 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2303 * @param output The HTTP connection to the client application.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2304 * @param redirection Where to redirect.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2305 * @ingroup REST
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2306 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2307 ORTHANC_PLUGIN_INLINE void OrthancPluginRedirect(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2308 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2309 OrthancPluginRestOutput* output,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2310 const char* redirection)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2311 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2312 _OrthancPluginOutputPlusArgument params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2313 params.output = output;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2314 params.argument = redirection;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2315 context->InvokeService(context, _OrthancPluginService_Redirect, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2316 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2317
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2318
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2319
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2320 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2321 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2322 char** result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2323 const char* argument;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2324 } _OrthancPluginRetrieveDynamicString;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2325
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2326 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2327 * @brief Look for a patient.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2328 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2329 * Look for a patient stored in Orthanc, using its Patient ID tag (0x0010, 0x0020).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2330 * This function uses the database index to run as fast as possible (it does not loop
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2331 * over all the stored patients).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2332 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2333 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2334 * @param patientID The Patient ID of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2335 * @return The NULL value if the patient is non-existent, or a string containing the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2336 * Orthanc ID of the patient. This string must be freed by OrthancPluginFreeString().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2337 * @ingroup Orthanc
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2338 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2339 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupPatient(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2340 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2341 const char* patientID)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2342 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2343 char* result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2344
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2345 _OrthancPluginRetrieveDynamicString params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2346 params.result = &result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2347 params.argument = patientID;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2348
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2349 if (context->InvokeService(context, _OrthancPluginService_LookupPatient, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2350 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2351 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2352 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2353 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2354 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2355 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2356 return result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2357 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2358 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2359
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2360
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2361 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2362 * @brief Look for a study.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2363 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2364 * Look for a study stored in Orthanc, using its Study Instance UID tag (0x0020, 0x000d).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2365 * This function uses the database index to run as fast as possible (it does not loop
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2366 * over all the stored studies).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2367 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2368 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2369 * @param studyUID The Study Instance UID of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2370 * @return The NULL value if the study is non-existent, or a string containing the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2371 * Orthanc ID of the study. This string must be freed by OrthancPluginFreeString().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2372 * @ingroup Orthanc
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2373 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2374 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudy(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2375 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2376 const char* studyUID)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2377 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2378 char* result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2379
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2380 _OrthancPluginRetrieveDynamicString params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2381 params.result = &result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2382 params.argument = studyUID;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2383
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2384 if (context->InvokeService(context, _OrthancPluginService_LookupStudy, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2385 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2386 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2387 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2388 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2389 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2390 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2391 return result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2392 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2393 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2394
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2395
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2396 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2397 * @brief Look for a study, using the accession number.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2398 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2399 * Look for a study stored in Orthanc, using its Accession Number tag (0x0008, 0x0050).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2400 * This function uses the database index to run as fast as possible (it does not loop
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2401 * over all the stored studies).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2402 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2403 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2404 * @param accessionNumber The Accession Number of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2405 * @return The NULL value if the study is non-existent, or a string containing the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2406 * Orthanc ID of the study. This string must be freed by OrthancPluginFreeString().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2407 * @ingroup Orthanc
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2408 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2409 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudyWithAccessionNumber(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2410 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2411 const char* accessionNumber)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2412 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2413 char* result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2414
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2415 _OrthancPluginRetrieveDynamicString params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2416 params.result = &result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2417 params.argument = accessionNumber;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2418
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2419 if (context->InvokeService(context, _OrthancPluginService_LookupStudyWithAccessionNumber, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2420 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2421 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2422 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2423 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2424 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2425 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2426 return result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2427 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2428 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2429
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2430
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2431 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2432 * @brief Look for a series.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2433 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2434 * Look for a series stored in Orthanc, using its Series Instance UID tag (0x0020, 0x000e).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2435 * This function uses the database index to run as fast as possible (it does not loop
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2436 * over all the stored series).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2437 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2438 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2439 * @param seriesUID The Series Instance UID of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2440 * @return The NULL value if the series is non-existent, or a string containing the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2441 * Orthanc ID of the series. This string must be freed by OrthancPluginFreeString().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2442 * @ingroup Orthanc
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2443 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2444 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupSeries(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2445 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2446 const char* seriesUID)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2447 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2448 char* result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2449
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2450 _OrthancPluginRetrieveDynamicString params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2451 params.result = &result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2452 params.argument = seriesUID;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2453
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2454 if (context->InvokeService(context, _OrthancPluginService_LookupSeries, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2455 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2456 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2457 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2458 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2459 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2460 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2461 return result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2462 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2463 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2464
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2465
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2466 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2467 * @brief Look for an instance.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2468 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2469 * Look for an instance stored in Orthanc, using its SOP Instance UID tag (0x0008, 0x0018).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2470 * This function uses the database index to run as fast as possible (it does not loop
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2471 * over all the stored instances).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2472 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2473 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2474 * @param sopInstanceUID The SOP Instance UID of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2475 * @return The NULL value if the instance is non-existent, or a string containing the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2476 * Orthanc ID of the instance. This string must be freed by OrthancPluginFreeString().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2477 * @ingroup Orthanc
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2478 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2479 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupInstance(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2480 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2481 const char* sopInstanceUID)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2482 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2483 char* result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2484
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2485 _OrthancPluginRetrieveDynamicString params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2486 params.result = &result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2487 params.argument = sopInstanceUID;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2488
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2489 if (context->InvokeService(context, _OrthancPluginService_LookupInstance, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2490 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2491 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2492 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2493 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2494 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2495 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2496 return result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2497 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2498 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2499
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2500
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2501
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2502 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2503 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2504 OrthancPluginRestOutput* output;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2505 uint16_t status;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2506 } _OrthancPluginSendHttpStatusCode;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2507
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2508 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2509 * @brief Send a HTTP status code.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2510 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2511 * This function answers to a REST request by sending a HTTP status
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2512 * code (such as "400 - Bad Request"). Note that:
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2513 * - Successful requests (status 200) must use ::OrthancPluginAnswerBuffer().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2514 * - Redirections (status 301) must use ::OrthancPluginRedirect().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2515 * - Unauthorized access (status 401) must use ::OrthancPluginSendUnauthorized().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2516 * - Methods not allowed (status 405) must use ::OrthancPluginSendMethodNotAllowed().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2517 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2518 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2519 * @param output The HTTP connection to the client application.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2520 * @param status The HTTP status code to be sent.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2521 * @ingroup REST
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2522 * @see OrthancPluginSendHttpStatus()
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2523 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2524 ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatusCode(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2525 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2526 OrthancPluginRestOutput* output,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2527 uint16_t status)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2528 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2529 _OrthancPluginSendHttpStatusCode params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2530 params.output = output;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2531 params.status = status;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2532 context->InvokeService(context, _OrthancPluginService_SendHttpStatusCode, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2533 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2534
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2535
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2536 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2537 * @brief Signal that a REST request is not authorized.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2538 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2539 * This function answers to a REST request by signaling that it is
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2540 * not authorized.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2541 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2542 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2543 * @param output The HTTP connection to the client application.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2544 * @param realm The realm for the authorization process.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2545 * @ingroup REST
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2546 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2547 ORTHANC_PLUGIN_INLINE void OrthancPluginSendUnauthorized(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2548 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2549 OrthancPluginRestOutput* output,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2550 const char* realm)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2551 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2552 _OrthancPluginOutputPlusArgument params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2553 params.output = output;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2554 params.argument = realm;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2555 context->InvokeService(context, _OrthancPluginService_SendUnauthorized, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2556 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2557
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2558
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2559 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2560 * @brief Signal that this URI does not support this HTTP method.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2561 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2562 * This function answers to a REST request by signaling that the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2563 * queried URI does not support this method.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2564 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2565 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2566 * @param output The HTTP connection to the client application.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2567 * @param allowedMethods The allowed methods for this URI (e.g. "GET,POST" after a PUT or a POST request).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2568 * @ingroup REST
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2569 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2570 ORTHANC_PLUGIN_INLINE void OrthancPluginSendMethodNotAllowed(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2571 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2572 OrthancPluginRestOutput* output,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2573 const char* allowedMethods)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2574 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2575 _OrthancPluginOutputPlusArgument params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2576 params.output = output;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2577 params.argument = allowedMethods;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2578 context->InvokeService(context, _OrthancPluginService_SendMethodNotAllowed, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2579 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2580
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2581
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2582 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2583 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2584 OrthancPluginRestOutput* output;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2585 const char* key;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2586 const char* value;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2587 } _OrthancPluginSetHttpHeader;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2588
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2589 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2590 * @brief Set a cookie.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2591 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2592 * This function sets a cookie in the HTTP client.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2593 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2594 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2595 * @param output The HTTP connection to the client application.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2596 * @param cookie The cookie to be set.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2597 * @param value The value of the cookie.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2598 * @ingroup REST
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2599 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2600 ORTHANC_PLUGIN_INLINE void OrthancPluginSetCookie(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2601 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2602 OrthancPluginRestOutput* output,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2603 const char* cookie,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2604 const char* value)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2605 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2606 _OrthancPluginSetHttpHeader params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2607 params.output = output;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2608 params.key = cookie;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2609 params.value = value;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2610 context->InvokeService(context, _OrthancPluginService_SetCookie, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2611 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2612
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2613
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2614 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2615 * @brief Set some HTTP header.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2616 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2617 * This function sets a HTTP header in the HTTP answer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2618 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2619 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2620 * @param output The HTTP connection to the client application.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2621 * @param key The HTTP header to be set.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2622 * @param value The value of the HTTP header.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2623 * @ingroup REST
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2624 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2625 ORTHANC_PLUGIN_INLINE void OrthancPluginSetHttpHeader(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2626 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2627 OrthancPluginRestOutput* output,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2628 const char* key,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2629 const char* value)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2630 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2631 _OrthancPluginSetHttpHeader params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2632 params.output = output;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2633 params.key = key;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2634 params.value = value;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2635 context->InvokeService(context, _OrthancPluginService_SetHttpHeader, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2636 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2637
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2638
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2639 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2640 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2641 char** resultStringToFree;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2642 const char** resultString;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2643 int64_t* resultInt64;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2644 const char* key;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2645 OrthancPluginDicomInstance* instance;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2646 OrthancPluginInstanceOrigin* resultOrigin; /* New in Orthanc 0.9.5 SDK */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2647 } _OrthancPluginAccessDicomInstance;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2648
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2649
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2650 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2651 * @brief Get the AET of a DICOM instance.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2652 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2653 * This function returns the Application Entity Title (AET) of the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2654 * DICOM modality from which a DICOM instance originates.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2655 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2656 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2657 * @param instance The instance of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2658 * @return The AET if success, NULL if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2659 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2660 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2661 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceRemoteAet(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2662 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2663 OrthancPluginDicomInstance* instance)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2664 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2665 const char* result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2666
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2667 _OrthancPluginAccessDicomInstance params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2668 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2669 params.resultString = &result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2670 params.instance = instance;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2671
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2672 if (context->InvokeService(context, _OrthancPluginService_GetInstanceRemoteAet, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2673 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2674 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2675 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2676 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2677 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2678 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2679 return result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2680 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2681 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2682
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2683
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2684 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2685 * @brief Get the size of a DICOM file.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2686 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2687 * This function returns the number of bytes of the given DICOM instance.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2688 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2689 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2690 * @param instance The instance of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2691 * @return The size of the file, -1 in case of error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2692 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2693 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2694 ORTHANC_PLUGIN_INLINE int64_t OrthancPluginGetInstanceSize(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2695 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2696 OrthancPluginDicomInstance* instance)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2697 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2698 int64_t size;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2699
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2700 _OrthancPluginAccessDicomInstance params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2701 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2702 params.resultInt64 = &size;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2703 params.instance = instance;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2704
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2705 if (context->InvokeService(context, _OrthancPluginService_GetInstanceSize, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2706 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2707 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2708 return -1;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2709 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2710 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2711 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2712 return size;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2713 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2714 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2715
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2716
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2717 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2718 * @brief Get the data of a DICOM file.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2719 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2720 * This function returns a pointer to the content of the given DICOM instance.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2721 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2722 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2723 * @param instance The instance of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2724 * @return The pointer to the DICOM data, NULL in case of error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2725 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2726 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2727 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceData(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2728 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2729 OrthancPluginDicomInstance* instance)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2730 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2731 const char* result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2732
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2733 _OrthancPluginAccessDicomInstance params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2734 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2735 params.resultString = &result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2736 params.instance = instance;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2737
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2738 if (context->InvokeService(context, _OrthancPluginService_GetInstanceData, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2739 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2740 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2741 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2742 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2743 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2744 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2745 return result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2746 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2747 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2748
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2749
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2750 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2751 * @brief Get the DICOM tag hierarchy as a JSON file.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2752 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2753 * This function returns a pointer to a newly created string
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2754 * containing a JSON file. This JSON file encodes the tag hierarchy
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2755 * of the given DICOM instance.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2756 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2757 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2758 * @param instance The instance of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2759 * @return The NULL value in case of error, or a string containing the JSON file.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2760 * This string must be freed by OrthancPluginFreeString().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2761 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2762 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2763 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceJson(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2764 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2765 OrthancPluginDicomInstance* instance)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2766 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2767 char* result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2768
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2769 _OrthancPluginAccessDicomInstance params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2770 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2771 params.resultStringToFree = &result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2772 params.instance = instance;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2773
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2774 if (context->InvokeService(context, _OrthancPluginService_GetInstanceJson, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2775 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2776 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2777 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2778 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2779 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2780 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2781 return result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2782 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2783 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2784
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2785
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2786 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2787 * @brief Get the DICOM tag hierarchy as a JSON file (with simplification).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2788 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2789 * This function returns a pointer to a newly created string
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2790 * containing a JSON file. This JSON file encodes the tag hierarchy
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2791 * of the given DICOM instance. In contrast with
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2792 * ::OrthancPluginGetInstanceJson(), the returned JSON file is in
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2793 * its simplified version.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2794 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2795 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2796 * @param instance The instance of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2797 * @return The NULL value in case of error, or a string containing the JSON file.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2798 * This string must be freed by OrthancPluginFreeString().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2799 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2800 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2801 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceSimplifiedJson(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2802 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2803 OrthancPluginDicomInstance* instance)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2804 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2805 char* result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2806
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2807 _OrthancPluginAccessDicomInstance params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2808 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2809 params.resultStringToFree = &result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2810 params.instance = instance;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2811
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2812 if (context->InvokeService(context, _OrthancPluginService_GetInstanceSimplifiedJson, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2813 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2814 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2815 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2816 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2817 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2818 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2819 return result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2820 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2821 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2822
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2823
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2824 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2825 * @brief Check whether a DICOM instance is associated with some metadata.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2826 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2827 * This function checks whether the DICOM instance of interest is
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2828 * associated with some metadata. As of Orthanc 0.8.1, in the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2829 * callbacks registered by
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2830 * ::OrthancPluginRegisterOnStoredInstanceCallback(), the only
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2831 * possibly available metadata are "ReceptionDate", "RemoteAET" and
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2832 * "IndexInSeries".
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2833 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2834 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2835 * @param instance The instance of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2836 * @param metadata The metadata of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2837 * @return 1 if the metadata is present, 0 if it is absent, -1 in case of error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2838 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2839 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2840 ORTHANC_PLUGIN_INLINE int OrthancPluginHasInstanceMetadata(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2841 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2842 OrthancPluginDicomInstance* instance,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2843 const char* metadata)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2844 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2845 int64_t result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2846
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2847 _OrthancPluginAccessDicomInstance params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2848 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2849 params.resultInt64 = &result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2850 params.instance = instance;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2851 params.key = metadata;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2852
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2853 if (context->InvokeService(context, _OrthancPluginService_HasInstanceMetadata, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2854 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2855 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2856 return -1;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2857 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2858 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2859 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2860 return (result != 0);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2861 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2862 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2863
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2864
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2865 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2866 * @brief Get the value of some metadata associated with a given DICOM instance.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2867 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2868 * This functions returns the value of some metadata that is associated with the DICOM instance of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2869 * Before calling this function, the existence of the metadata must have been checked with
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2870 * ::OrthancPluginHasInstanceMetadata().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2871 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2872 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2873 * @param instance The instance of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2874 * @param metadata The metadata of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2875 * @return The metadata value if success, NULL if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2876 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2877 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2878 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceMetadata(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2879 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2880 OrthancPluginDicomInstance* instance,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2881 const char* metadata)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2882 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2883 const char* result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2884
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2885 _OrthancPluginAccessDicomInstance params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2886 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2887 params.resultString = &result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2888 params.instance = instance;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2889 params.key = metadata;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2890
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2891 if (context->InvokeService(context, _OrthancPluginService_GetInstanceMetadata, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2892 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2893 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2894 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2895 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2896 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2897 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2898 return result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2899 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2900 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2901
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2902
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2903
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2904 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2905 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2906 OrthancPluginStorageCreate create;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2907 OrthancPluginStorageRead read;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2908 OrthancPluginStorageRemove remove;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2909 OrthancPluginFree free;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2910 } _OrthancPluginRegisterStorageArea;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2911
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2912 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2913 * @brief Register a custom storage area.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2914 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2915 * This function registers a custom storage area, to replace the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2916 * built-in way Orthanc stores its files on the filesystem. This
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2917 * function must be called during the initialization of the plugin,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2918 * i.e. inside the OrthancPluginInitialize() public function.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2919 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2920 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2921 * @param create The callback function to store a file on the custom storage area.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2922 * @param read The callback function to read a file from the custom storage area.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2923 * @param remove The callback function to remove a file from the custom storage area.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2924 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2925 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2926 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterStorageArea(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2927 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2928 OrthancPluginStorageCreate create,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2929 OrthancPluginStorageRead read,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2930 OrthancPluginStorageRemove remove)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2931 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2932 _OrthancPluginRegisterStorageArea params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2933 params.create = create;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2934 params.read = read;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2935 params.remove = remove;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2936
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2937 #ifdef __cplusplus
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2938 params.free = ::free;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2939 #else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2940 params.free = free;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2941 #endif
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2942
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2943 context->InvokeService(context, _OrthancPluginService_RegisterStorageArea, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2944 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2945
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2946
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2947
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2948 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2949 * @brief Return the path to the Orthanc executable.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2950 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2951 * This function returns the path to the Orthanc executable.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2952 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2953 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2954 * @return NULL in the case of an error, or a newly allocated string
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2955 * containing the path. This string must be freed by
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2956 * OrthancPluginFreeString().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2957 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2958 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancPath(OrthancPluginContext* context)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2959 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2960 char* result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2961
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2962 _OrthancPluginRetrieveDynamicString params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2963 params.result = &result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2964 params.argument = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2965
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2966 if (context->InvokeService(context, _OrthancPluginService_GetOrthancPath, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2967 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2968 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2969 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2970 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2971 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2972 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2973 return result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2974 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2975 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2976
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2977
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2978 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2979 * @brief Return the directory containing the Orthanc.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2980 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2981 * This function returns the path to the directory containing the Orthanc executable.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2982 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2983 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2984 * @return NULL in the case of an error, or a newly allocated string
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2985 * containing the path. This string must be freed by
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2986 * OrthancPluginFreeString().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2987 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2988 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancDirectory(OrthancPluginContext* context)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2989 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2990 char* result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2991
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2992 _OrthancPluginRetrieveDynamicString params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2993 params.result = &result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2994 params.argument = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2995
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2996 if (context->InvokeService(context, _OrthancPluginService_GetOrthancDirectory, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2997 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2998 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2999 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3000 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3001 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3002 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3003 return result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3004 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3005 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3006
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3007
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3008 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3009 * @brief Return the path to the configuration file(s).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3010 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3011 * This function returns the path to the configuration file(s) that
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3012 * was specified when starting Orthanc. Since version 0.9.1, this
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3013 * path can refer to a folder that stores a set of configuration
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3014 * files. This function is deprecated in favor of
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3015 * OrthancPluginGetConfiguration().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3016 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3017 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3018 * @return NULL in the case of an error, or a newly allocated string
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3019 * containing the path. This string must be freed by
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3020 * OrthancPluginFreeString().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3021 * @see OrthancPluginGetConfiguration()
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3022 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3023 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfigurationPath(OrthancPluginContext* context)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3024 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3025 char* result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3026
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3027 _OrthancPluginRetrieveDynamicString params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3028 params.result = &result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3029 params.argument = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3030
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3031 if (context->InvokeService(context, _OrthancPluginService_GetConfigurationPath, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3032 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3033 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3034 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3035 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3036 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3037 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3038 return result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3039 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3040 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3041
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3042
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3043
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3044 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3045 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3046 OrthancPluginOnChangeCallback callback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3047 } _OrthancPluginOnChangeCallback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3048
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3049 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3050 * @brief Register a callback to monitor changes.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3051 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3052 * This function registers a callback function that is called
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3053 * whenever a change happens to some DICOM resource.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3054 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3055 * @warning If your change callback has to call the REST API of
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3056 * Orthanc, you should make these calls in a separate thread (with
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3057 * the events passing through a message queue). Otherwise, this
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3058 * could result in deadlocks in the presence of other plugins or Lua
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3059 * scripts.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3060 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3061 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3062 * @param callback The callback function.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3063 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3064 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3065 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnChangeCallback(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3066 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3067 OrthancPluginOnChangeCallback callback)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3068 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3069 _OrthancPluginOnChangeCallback params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3070 params.callback = callback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3071
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3072 context->InvokeService(context, _OrthancPluginService_RegisterOnChangeCallback, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3073 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3074
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3075
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3076
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3077 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3078 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3079 const char* plugin;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3080 _OrthancPluginProperty property;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3081 const char* value;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3082 } _OrthancPluginSetPluginProperty;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3083
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3084
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3085 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3086 * @brief Set the URI where the plugin provides its Web interface.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3087 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3088 * For plugins that come with a Web interface, this function
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3089 * declares the entry path where to find this interface. This
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3090 * information is notably used in the "Plugins" page of Orthanc
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3091 * Explorer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3092 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3093 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3094 * @param uri The root URI for this plugin.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3095 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3096 ORTHANC_PLUGIN_INLINE void OrthancPluginSetRootUri(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3097 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3098 const char* uri)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3099 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3100 _OrthancPluginSetPluginProperty params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3101 params.plugin = OrthancPluginGetName();
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3102 params.property = _OrthancPluginProperty_RootUri;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3103 params.value = uri;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3104
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3105 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3106 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3107
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3108
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3109 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3110 * @brief Set a description for this plugin.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3111 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3112 * Set a description for this plugin. It is displayed in the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3113 * "Plugins" page of Orthanc Explorer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3114 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3115 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3116 * @param description The description.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3117 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3118 ORTHANC_PLUGIN_INLINE void OrthancPluginSetDescription(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3119 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3120 const char* description)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3121 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3122 _OrthancPluginSetPluginProperty params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3123 params.plugin = OrthancPluginGetName();
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3124 params.property = _OrthancPluginProperty_Description;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3125 params.value = description;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3126
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3127 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3128 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3129
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3130
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3131 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3132 * @brief Extend the JavaScript code of Orthanc Explorer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3133 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3134 * Add JavaScript code to customize the default behavior of Orthanc
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3135 * Explorer. This can for instance be used to add new buttons.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3136 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3137 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3138 * @param javascript The custom JavaScript code.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3139 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3140 ORTHANC_PLUGIN_INLINE void OrthancPluginExtendOrthancExplorer(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3141 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3142 const char* javascript)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3143 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3144 _OrthancPluginSetPluginProperty params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3145 params.plugin = OrthancPluginGetName();
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3146 params.property = _OrthancPluginProperty_OrthancExplorer;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3147 params.value = javascript;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3148
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3149 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3150 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3151
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3152
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3153 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3154 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3155 char** result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3156 int32_t property;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3157 const char* value;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3158 } _OrthancPluginGlobalProperty;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3159
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3160
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3161 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3162 * @brief Get the value of a global property.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3163 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3164 * Get the value of a global property that is stored in the Orthanc database. Global
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3165 * properties whose index is below 1024 are reserved by Orthanc.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3166 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3167 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3168 * @param property The global property of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3169 * @param defaultValue The value to return, if the global property is unset.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3170 * @return The value of the global property, or NULL in the case of an error. This
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3171 * string must be freed by OrthancPluginFreeString().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3172 * @ingroup Orthanc
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3173 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3174 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetGlobalProperty(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3175 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3176 int32_t property,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3177 const char* defaultValue)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3178 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3179 char* result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3180
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3181 _OrthancPluginGlobalProperty params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3182 params.result = &result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3183 params.property = property;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3184 params.value = defaultValue;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3185
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3186 if (context->InvokeService(context, _OrthancPluginService_GetGlobalProperty, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3187 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3188 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3189 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3190 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3191 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3192 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3193 return result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3194 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3195 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3196
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3197
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3198 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3199 * @brief Set the value of a global property.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3200 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3201 * Set the value of a global property into the Orthanc
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3202 * database. Setting a global property can be used by plugins to
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3203 * save their internal parameters. Plugins are only allowed to set
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3204 * properties whose index are above or equal to 1024 (properties
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3205 * below 1024 are read-only and reserved by Orthanc).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3206 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3207 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3208 * @param property The global property of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3209 * @param value The value to be set in the global property.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3210 * @return 0 if success, or the error code if failure.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3211 * @ingroup Orthanc
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3212 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3213 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSetGlobalProperty(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3214 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3215 int32_t property,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3216 const char* value)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3217 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3218 _OrthancPluginGlobalProperty params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3219 params.result = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3220 params.property = property;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3221 params.value = value;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3222
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3223 return context->InvokeService(context, _OrthancPluginService_SetGlobalProperty, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3224 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3225
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3226
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3227
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3228 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3229 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3230 int32_t *resultInt32;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3231 uint32_t *resultUint32;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3232 int64_t *resultInt64;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3233 uint64_t *resultUint64;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3234 } _OrthancPluginReturnSingleValue;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3235
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3236 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3237 * @brief Get the number of command-line arguments.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3238 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3239 * Retrieve the number of command-line arguments that were used to launch Orthanc.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3240 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3241 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3242 * @return The number of arguments.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3243 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3244 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetCommandLineArgumentsCount(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3245 OrthancPluginContext* context)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3246 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3247 uint32_t count = 0;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3248
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3249 _OrthancPluginReturnSingleValue params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3250 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3251 params.resultUint32 = &count;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3252
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3253 if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgumentsCount, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3254 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3255 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3256 return 0;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3257 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3258 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3259 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3260 return count;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3261 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3262 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3263
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3264
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3265
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3266 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3267 * @brief Get the value of a command-line argument.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3268 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3269 * Get the value of one of the command-line arguments that were used
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3270 * to launch Orthanc. The number of available arguments can be
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3271 * retrieved by OrthancPluginGetCommandLineArgumentsCount().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3272 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3273 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3274 * @param argument The index of the argument.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3275 * @return The value of the argument, or NULL in the case of an error. This
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3276 * string must be freed by OrthancPluginFreeString().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3277 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3278 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetCommandLineArgument(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3279 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3280 uint32_t argument)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3281 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3282 char* result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3283
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3284 _OrthancPluginGlobalProperty params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3285 params.result = &result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3286 params.property = (int32_t) argument;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3287 params.value = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3288
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3289 if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgument, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3290 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3291 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3292 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3293 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3294 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3295 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3296 return result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3297 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3298 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3299
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3300
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3301 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3302 * @brief Get the expected version of the database schema.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3303 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3304 * Retrieve the expected version of the database schema.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3305 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3306 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3307 * @return The version.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3308 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3309 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3310 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetExpectedDatabaseVersion(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3311 OrthancPluginContext* context)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3312 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3313 uint32_t count = 0;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3314
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3315 _OrthancPluginReturnSingleValue params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3316 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3317 params.resultUint32 = &count;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3318
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3319 if (context->InvokeService(context, _OrthancPluginService_GetExpectedDatabaseVersion, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3320 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3321 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3322 return 0;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3323 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3324 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3325 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3326 return count;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3327 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3328 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3329
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3330
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3331
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3332 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3333 * @brief Return the content of the configuration file(s).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3334 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3335 * This function returns the content of the configuration that is
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3336 * used by Orthanc, formatted as a JSON string.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3337 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3338 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3339 * @return NULL in the case of an error, or a newly allocated string
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3340 * containing the configuration. This string must be freed by
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3341 * OrthancPluginFreeString().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3342 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3343 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfiguration(OrthancPluginContext* context)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3344 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3345 char* result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3346
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3347 _OrthancPluginRetrieveDynamicString params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3348 params.result = &result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3349 params.argument = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3350
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3351 if (context->InvokeService(context, _OrthancPluginService_GetConfiguration, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3352 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3353 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3354 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3355 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3356 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3357 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3358 return result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3359 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3360 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3361
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3362
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3363
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3364 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3365 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3366 OrthancPluginRestOutput* output;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3367 const char* subType;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3368 const char* contentType;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3369 } _OrthancPluginStartMultipartAnswer;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3370
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3371 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3372 * @brief Start an HTTP multipart answer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3373 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3374 * Initiates a HTTP multipart answer, as the result of a REST request.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3375 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3376 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3377 * @param output The HTTP connection to the client application.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3378 * @param subType The sub-type of the multipart answer ("mixed" or "related").
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3379 * @param contentType The MIME type of the items in the multipart answer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3380 * @return 0 if success, or the error code if failure.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3381 * @see OrthancPluginSendMultipartItem(), OrthancPluginSendMultipartItem2()
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3382 * @ingroup REST
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3383 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3384 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStartMultipartAnswer(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3385 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3386 OrthancPluginRestOutput* output,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3387 const char* subType,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3388 const char* contentType)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3389 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3390 _OrthancPluginStartMultipartAnswer params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3391 params.output = output;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3392 params.subType = subType;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3393 params.contentType = contentType;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3394 return context->InvokeService(context, _OrthancPluginService_StartMultipartAnswer, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3395 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3396
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3397
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3398 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3399 * @brief Send an item as a part of some HTTP multipart answer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3400 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3401 * This function sends an item as a part of some HTTP multipart
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3402 * answer that was initiated by OrthancPluginStartMultipartAnswer().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3403 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3404 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3405 * @param output The HTTP connection to the client application.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3406 * @param answer Pointer to the memory buffer containing the item.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3407 * @param answerSize Number of bytes of the item.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3408 * @return 0 if success, or the error code if failure (this notably happens
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3409 * if the connection is closed by the client).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3410 * @see OrthancPluginSendMultipartItem2()
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3411 * @ingroup REST
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3412 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3413 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSendMultipartItem(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3414 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3415 OrthancPluginRestOutput* output,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3416 const char* answer,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3417 uint32_t answerSize)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3418 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3419 _OrthancPluginAnswerBuffer params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3420 params.output = output;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3421 params.answer = answer;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3422 params.answerSize = answerSize;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3423 params.mimeType = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3424 return context->InvokeService(context, _OrthancPluginService_SendMultipartItem, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3425 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3426
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3427
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3428
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3429 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3430 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3431 OrthancPluginMemoryBuffer* target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3432 const void* source;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3433 uint32_t size;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3434 OrthancPluginCompressionType compression;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3435 uint8_t uncompress;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3436 } _OrthancPluginBufferCompression;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3437
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3438
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3439 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3440 * @brief Compress or decompress a buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3441 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3442 * This function compresses or decompresses a buffer, using the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3443 * version of the zlib library that is used by the Orthanc core.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3444 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3445 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3446 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3447 * @param source The source buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3448 * @param size The size in bytes of the source buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3449 * @param compression The compression algorithm.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3450 * @param uncompress If set to "0", the buffer must be compressed.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3451 * If set to "1", the buffer must be uncompressed.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3452 * @return 0 if success, or the error code if failure.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3453 * @ingroup Images
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3454 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3455 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginBufferCompression(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3456 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3457 OrthancPluginMemoryBuffer* target,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3458 const void* source,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3459 uint32_t size,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3460 OrthancPluginCompressionType compression,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3461 uint8_t uncompress)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3462 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3463 _OrthancPluginBufferCompression params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3464 params.target = target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3465 params.source = source;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3466 params.size = size;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3467 params.compression = compression;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3468 params.uncompress = uncompress;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3469
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3470 return context->InvokeService(context, _OrthancPluginService_BufferCompression, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3471 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3472
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3473
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3474
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3475 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3476 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3477 OrthancPluginMemoryBuffer* target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3478 const char* path;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3479 } _OrthancPluginReadFile;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3480
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3481 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3482 * @brief Read a file.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3483 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3484 * Read the content of a file on the filesystem, and returns it into
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3485 * a newly allocated memory buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3486 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3487 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3488 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3489 * @param path The path of the file to be read.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3490 * @return 0 if success, or the error code if failure.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3491 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3492 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginReadFile(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3493 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3494 OrthancPluginMemoryBuffer* target,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3495 const char* path)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3496 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3497 _OrthancPluginReadFile params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3498 params.target = target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3499 params.path = path;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3500 return context->InvokeService(context, _OrthancPluginService_ReadFile, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3501 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3502
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3503
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3504
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3505 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3506 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3507 const char* path;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3508 const void* data;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3509 uint32_t size;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3510 } _OrthancPluginWriteFile;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3511
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3512 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3513 * @brief Write a file.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3514 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3515 * Write the content of a memory buffer to the filesystem.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3516 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3517 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3518 * @param path The path of the file to be written.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3519 * @param data The content of the memory buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3520 * @param size The size of the memory buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3521 * @return 0 if success, or the error code if failure.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3522 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3523 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWriteFile(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3524 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3525 const char* path,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3526 const void* data,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3527 uint32_t size)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3528 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3529 _OrthancPluginWriteFile params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3530 params.path = path;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3531 params.data = data;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3532 params.size = size;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3533 return context->InvokeService(context, _OrthancPluginService_WriteFile, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3534 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3535
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3536
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3537
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3538 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3539 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3540 const char** target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3541 OrthancPluginErrorCode error;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3542 } _OrthancPluginGetErrorDescription;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3543
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3544 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3545 * @brief Get the description of a given error code.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3546 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3547 * This function returns the description of a given error code.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3548 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3549 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3550 * @param error The error code of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3551 * @return The error description. This is a statically-allocated
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3552 * string, do not free it.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3553 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3554 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetErrorDescription(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3555 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3556 OrthancPluginErrorCode error)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3557 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3558 const char* result = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3559
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3560 _OrthancPluginGetErrorDescription params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3561 params.target = &result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3562 params.error = error;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3563
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3564 if (context->InvokeService(context, _OrthancPluginService_GetErrorDescription, &params) != OrthancPluginErrorCode_Success ||
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3565 result == NULL)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3566 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3567 return "Unknown error code";
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3568 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3569 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3570 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3571 return result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3572 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3573 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3574
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3575
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3576
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3577 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3578 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3579 OrthancPluginRestOutput* output;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3580 uint16_t status;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3581 const char* body;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3582 uint32_t bodySize;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3583 } _OrthancPluginSendHttpStatus;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3584
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3585 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3586 * @brief Send a HTTP status, with a custom body.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3587 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3588 * This function answers to a HTTP request by sending a HTTP status
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3589 * code (such as "400 - Bad Request"), together with a body
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3590 * describing the error. The body will only be returned if the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3591 * configuration option "HttpDescribeErrors" of Orthanc is set to "true".
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3592 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3593 * Note that:
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3594 * - Successful requests (status 200) must use ::OrthancPluginAnswerBuffer().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3595 * - Redirections (status 301) must use ::OrthancPluginRedirect().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3596 * - Unauthorized access (status 401) must use ::OrthancPluginSendUnauthorized().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3597 * - Methods not allowed (status 405) must use ::OrthancPluginSendMethodNotAllowed().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3598 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3599 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3600 * @param output The HTTP connection to the client application.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3601 * @param status The HTTP status code to be sent.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3602 * @param body The body of the answer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3603 * @param bodySize The size of the body.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3604 * @see OrthancPluginSendHttpStatusCode()
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3605 * @ingroup REST
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3606 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3607 ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatus(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3608 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3609 OrthancPluginRestOutput* output,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3610 uint16_t status,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3611 const char* body,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3612 uint32_t bodySize)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3613 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3614 _OrthancPluginSendHttpStatus params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3615 params.output = output;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3616 params.status = status;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3617 params.body = body;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3618 params.bodySize = bodySize;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3619 context->InvokeService(context, _OrthancPluginService_SendHttpStatus, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3620 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3621
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3622
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3623
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3624 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3625 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3626 const OrthancPluginImage* image;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3627 uint32_t* resultUint32;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3628 OrthancPluginPixelFormat* resultPixelFormat;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3629 void** resultBuffer;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3630 } _OrthancPluginGetImageInfo;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3631
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3632
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3633 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3634 * @brief Return the pixel format of an image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3635 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3636 * This function returns the type of memory layout for the pixels of the given image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3637 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3638 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3639 * @param image The image of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3640 * @return The pixel format.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3641 * @ingroup Images
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3642 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3643 ORTHANC_PLUGIN_INLINE OrthancPluginPixelFormat OrthancPluginGetImagePixelFormat(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3644 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3645 const OrthancPluginImage* image)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3646 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3647 OrthancPluginPixelFormat target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3648
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3649 _OrthancPluginGetImageInfo params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3650 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3651 params.image = image;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3652 params.resultPixelFormat = &target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3653
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3654 if (context->InvokeService(context, _OrthancPluginService_GetImagePixelFormat, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3655 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3656 return OrthancPluginPixelFormat_Unknown;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3657 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3658 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3659 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3660 return (OrthancPluginPixelFormat) target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3661 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3662 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3663
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3664
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3665
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3666 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3667 * @brief Return the width of an image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3668 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3669 * This function returns the width of the given image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3670 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3671 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3672 * @param image The image of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3673 * @return The width.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3674 * @ingroup Images
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3675 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3676 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageWidth(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3677 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3678 const OrthancPluginImage* image)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3679 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3680 uint32_t width;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3681
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3682 _OrthancPluginGetImageInfo params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3683 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3684 params.image = image;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3685 params.resultUint32 = &width;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3686
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3687 if (context->InvokeService(context, _OrthancPluginService_GetImageWidth, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3688 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3689 return 0;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3690 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3691 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3692 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3693 return width;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3694 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3695 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3696
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3697
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3698
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3699 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3700 * @brief Return the height of an image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3701 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3702 * This function returns the height of the given image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3703 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3704 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3705 * @param image The image of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3706 * @return The height.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3707 * @ingroup Images
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3708 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3709 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageHeight(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3710 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3711 const OrthancPluginImage* image)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3712 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3713 uint32_t height;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3714
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3715 _OrthancPluginGetImageInfo params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3716 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3717 params.image = image;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3718 params.resultUint32 = &height;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3719
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3720 if (context->InvokeService(context, _OrthancPluginService_GetImageHeight, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3721 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3722 return 0;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3723 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3724 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3725 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3726 return height;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3727 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3728 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3729
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3730
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3731
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3732 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3733 * @brief Return the pitch of an image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3734 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3735 * This function returns the pitch of the given image. The pitch is
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3736 * defined as the number of bytes between 2 successive lines of the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3737 * image in the memory buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3738 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3739 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3740 * @param image The image of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3741 * @return The pitch.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3742 * @ingroup Images
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3743 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3744 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImagePitch(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3745 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3746 const OrthancPluginImage* image)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3747 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3748 uint32_t pitch;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3749
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3750 _OrthancPluginGetImageInfo params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3751 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3752 params.image = image;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3753 params.resultUint32 = &pitch;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3754
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3755 if (context->InvokeService(context, _OrthancPluginService_GetImagePitch, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3756 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3757 return 0;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3758 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3759 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3760 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3761 return pitch;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3762 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3763 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3764
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3765
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3766
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3767 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3768 * @brief Return a pointer to the content of an image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3769 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3770 * This function returns a pointer to the memory buffer that
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3771 * contains the pixels of the image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3772 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3773 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3774 * @param image The image of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3775 * @return The pointer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3776 * @ingroup Images
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3777 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3778 ORTHANC_PLUGIN_INLINE void* OrthancPluginGetImageBuffer(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3779 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3780 const OrthancPluginImage* image)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3781 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3782 void* target = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3783
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3784 _OrthancPluginGetImageInfo params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3785 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3786 params.resultBuffer = &target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3787 params.image = image;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3788
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3789 if (context->InvokeService(context, _OrthancPluginService_GetImageBuffer, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3790 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3791 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3792 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3793 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3794 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3795 return target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3796 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3797 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3798
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3799
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3800 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3801 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3802 OrthancPluginImage** target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3803 const void* data;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3804 uint32_t size;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3805 OrthancPluginImageFormat format;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3806 } _OrthancPluginUncompressImage;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3807
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3808
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3809 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3810 * @brief Decode a compressed image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3811 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3812 * This function decodes a compressed image from a memory buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3813 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3814 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3815 * @param data Pointer to a memory buffer containing the compressed image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3816 * @param size Size of the memory buffer containing the compressed image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3817 * @param format The file format of the compressed image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3818 * @return The uncompressed image. It must be freed with OrthancPluginFreeImage().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3819 * @ingroup Images
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3820 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3821 ORTHANC_PLUGIN_INLINE OrthancPluginImage *OrthancPluginUncompressImage(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3822 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3823 const void* data,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3824 uint32_t size,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3825 OrthancPluginImageFormat format)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3826 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3827 OrthancPluginImage* target = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3828
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3829 _OrthancPluginUncompressImage params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3830 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3831 params.target = &target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3832 params.data = data;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3833 params.size = size;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3834 params.format = format;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3835
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3836 if (context->InvokeService(context, _OrthancPluginService_UncompressImage, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3837 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3838 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3839 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3840 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3841 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3842 return target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3843 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3844 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3845
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3846
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3847
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3848
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3849 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3850 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3851 OrthancPluginImage* image;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3852 } _OrthancPluginFreeImage;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3853
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3854 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3855 * @brief Free an image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3856 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3857 * This function frees an image that was decoded with OrthancPluginUncompressImage().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3858 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3859 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3860 * @param image The image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3861 * @ingroup Images
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3862 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3863 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeImage(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3864 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3865 OrthancPluginImage* image)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3866 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3867 _OrthancPluginFreeImage params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3868 params.image = image;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3869
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3870 context->InvokeService(context, _OrthancPluginService_FreeImage, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3871 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3872
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3873
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3874
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3875
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3876 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3877 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3878 OrthancPluginMemoryBuffer* target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3879 OrthancPluginImageFormat imageFormat;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3880 OrthancPluginPixelFormat pixelFormat;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3881 uint32_t width;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3882 uint32_t height;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3883 uint32_t pitch;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3884 const void* buffer;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3885 uint8_t quality;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3886 } _OrthancPluginCompressImage;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3887
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3888
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3889 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3890 * @brief Encode a PNG image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3891 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3892 * This function compresses the given memory buffer containing an
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3893 * image using the PNG specification, and stores the result of the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3894 * compression into a newly allocated memory buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3895 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3896 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3897 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3898 * @param format The memory layout of the uncompressed image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3899 * @param width The width of the image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3900 * @param height The height of the image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3901 * @param pitch The pitch of the image (i.e. the number of bytes
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3902 * between 2 successive lines of the image in the memory buffer).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3903 * @param buffer The memory buffer containing the uncompressed image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3904 * @return 0 if success, or the error code if failure.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3905 * @see OrthancPluginCompressAndAnswerPngImage()
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3906 * @ingroup Images
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3907 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3908 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCompressPngImage(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3909 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3910 OrthancPluginMemoryBuffer* target,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3911 OrthancPluginPixelFormat format,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3912 uint32_t width,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3913 uint32_t height,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3914 uint32_t pitch,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3915 const void* buffer)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3916 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3917 _OrthancPluginCompressImage params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3918 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3919 params.target = target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3920 params.imageFormat = OrthancPluginImageFormat_Png;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3921 params.pixelFormat = format;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3922 params.width = width;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3923 params.height = height;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3924 params.pitch = pitch;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3925 params.buffer = buffer;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3926 params.quality = 0; /* Unused for PNG */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3927
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3928 return context->InvokeService(context, _OrthancPluginService_CompressImage, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3929 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3930
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3931
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3932 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3933 * @brief Encode a JPEG image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3934 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3935 * This function compresses the given memory buffer containing an
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3936 * image using the JPEG specification, and stores the result of the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3937 * compression into a newly allocated memory buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3938 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3939 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3940 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3941 * @param format The memory layout of the uncompressed image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3942 * @param width The width of the image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3943 * @param height The height of the image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3944 * @param pitch The pitch of the image (i.e. the number of bytes
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3945 * between 2 successive lines of the image in the memory buffer).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3946 * @param buffer The memory buffer containing the uncompressed image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3947 * @param quality The quality of the JPEG encoding, between 1 (worst
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3948 * quality, best compression) and 100 (best quality, worst
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3949 * compression).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3950 * @return 0 if success, or the error code if failure.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3951 * @ingroup Images
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3952 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3953 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCompressJpegImage(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3954 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3955 OrthancPluginMemoryBuffer* target,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3956 OrthancPluginPixelFormat format,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3957 uint32_t width,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3958 uint32_t height,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3959 uint32_t pitch,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3960 const void* buffer,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3961 uint8_t quality)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3962 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3963 _OrthancPluginCompressImage params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3964 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3965 params.target = target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3966 params.imageFormat = OrthancPluginImageFormat_Jpeg;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3967 params.pixelFormat = format;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3968 params.width = width;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3969 params.height = height;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3970 params.pitch = pitch;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3971 params.buffer = buffer;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3972 params.quality = quality;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3973
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3974 return context->InvokeService(context, _OrthancPluginService_CompressImage, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3975 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3976
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3977
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3978
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3979 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3980 * @brief Answer to a REST request with a JPEG image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3981 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3982 * This function answers to a REST request with a JPEG image. The
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3983 * parameters of this function describe a memory buffer that
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3984 * contains an uncompressed image. The image will be automatically compressed
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3985 * as a JPEG image by the core system of Orthanc.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3986 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3987 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3988 * @param output The HTTP connection to the client application.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3989 * @param format The memory layout of the uncompressed image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3990 * @param width The width of the image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3991 * @param height The height of the image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3992 * @param pitch The pitch of the image (i.e. the number of bytes
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3993 * between 2 successive lines of the image in the memory buffer).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3994 * @param buffer The memory buffer containing the uncompressed image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3995 * @param quality The quality of the JPEG encoding, between 1 (worst
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3996 * quality, best compression) and 100 (best quality, worst
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3997 * compression).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3998 * @ingroup REST
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3999 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4000 ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerJpegImage(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4001 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4002 OrthancPluginRestOutput* output,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4003 OrthancPluginPixelFormat format,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4004 uint32_t width,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4005 uint32_t height,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4006 uint32_t pitch,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4007 const void* buffer,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4008 uint8_t quality)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4009 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4010 _OrthancPluginCompressAndAnswerImage params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4011 params.output = output;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4012 params.imageFormat = OrthancPluginImageFormat_Jpeg;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4013 params.pixelFormat = format;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4014 params.width = width;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4015 params.height = height;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4016 params.pitch = pitch;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4017 params.buffer = buffer;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4018 params.quality = quality;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4019 context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4020 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4021
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4022
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4023
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4024
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4025 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4026 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4027 OrthancPluginMemoryBuffer* target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4028 OrthancPluginHttpMethod method;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4029 const char* url;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4030 const char* username;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4031 const char* password;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4032 const char* body;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4033 uint32_t bodySize;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4034 } _OrthancPluginCallHttpClient;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4035
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4036
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4037 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4038 * @brief Issue a HTTP GET call.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4039 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4040 * Make a HTTP GET call to the given URL. The result to the query is
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4041 * stored into a newly allocated memory buffer. Favor
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4042 * OrthancPluginRestApiGet() if calling the built-in REST API of the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4043 * Orthanc instance that hosts this plugin.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4044 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4045 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4046 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4047 * @param url The URL of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4048 * @param username The username (can be <tt>NULL</tt> if no password protection).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4049 * @param password The password (can be <tt>NULL</tt> if no password protection).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4050 * @return 0 if success, or the error code if failure.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4051 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4052 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpGet(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4053 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4054 OrthancPluginMemoryBuffer* target,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4055 const char* url,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4056 const char* username,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4057 const char* password)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4058 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4059 _OrthancPluginCallHttpClient params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4060 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4061
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4062 params.target = target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4063 params.method = OrthancPluginHttpMethod_Get;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4064 params.url = url;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4065 params.username = username;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4066 params.password = password;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4067
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4068 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4069 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4070
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4071
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4072 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4073 * @brief Issue a HTTP POST call.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4074 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4075 * Make a HTTP POST call to the given URL. The result to the query
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4076 * is stored into a newly allocated memory buffer. Favor
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4077 * OrthancPluginRestApiPost() if calling the built-in REST API of
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4078 * the Orthanc instance that hosts this plugin.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4079 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4080 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4081 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4082 * @param url The URL of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4083 * @param body The content of the body of the request.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4084 * @param bodySize The size of the body of the request.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4085 * @param username The username (can be <tt>NULL</tt> if no password protection).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4086 * @param password The password (can be <tt>NULL</tt> if no password protection).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4087 * @return 0 if success, or the error code if failure.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4088 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4089 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpPost(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4090 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4091 OrthancPluginMemoryBuffer* target,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4092 const char* url,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4093 const char* body,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4094 uint32_t bodySize,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4095 const char* username,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4096 const char* password)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4097 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4098 _OrthancPluginCallHttpClient params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4099 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4100
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4101 params.target = target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4102 params.method = OrthancPluginHttpMethod_Post;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4103 params.url = url;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4104 params.body = body;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4105 params.bodySize = bodySize;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4106 params.username = username;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4107 params.password = password;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4108
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4109 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4110 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4111
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4112
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4113 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4114 * @brief Issue a HTTP PUT call.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4115 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4116 * Make a HTTP PUT call to the given URL. The result to the query is
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4117 * stored into a newly allocated memory buffer. Favor
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4118 * OrthancPluginRestApiPut() if calling the built-in REST API of the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4119 * Orthanc instance that hosts this plugin.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4120 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4121 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4122 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4123 * @param url The URL of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4124 * @param body The content of the body of the request.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4125 * @param bodySize The size of the body of the request.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4126 * @param username The username (can be <tt>NULL</tt> if no password protection).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4127 * @param password The password (can be <tt>NULL</tt> if no password protection).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4128 * @return 0 if success, or the error code if failure.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4129 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4130 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpPut(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4131 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4132 OrthancPluginMemoryBuffer* target,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4133 const char* url,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4134 const char* body,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4135 uint32_t bodySize,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4136 const char* username,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4137 const char* password)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4138 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4139 _OrthancPluginCallHttpClient params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4140 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4141
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4142 params.target = target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4143 params.method = OrthancPluginHttpMethod_Put;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4144 params.url = url;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4145 params.body = body;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4146 params.bodySize = bodySize;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4147 params.username = username;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4148 params.password = password;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4149
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4150 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4151 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4152
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4153
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4154 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4155 * @brief Issue a HTTP DELETE call.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4156 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4157 * Make a HTTP DELETE call to the given URL. Favor
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4158 * OrthancPluginRestApiDelete() if calling the built-in REST API of
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4159 * the Orthanc instance that hosts this plugin.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4160 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4161 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4162 * @param url The URL of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4163 * @param username The username (can be <tt>NULL</tt> if no password protection).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4164 * @param password The password (can be <tt>NULL</tt> if no password protection).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4165 * @return 0 if success, or the error code if failure.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4166 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4167 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpDelete(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4168 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4169 const char* url,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4170 const char* username,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4171 const char* password)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4172 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4173 _OrthancPluginCallHttpClient params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4174 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4175
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4176 params.method = OrthancPluginHttpMethod_Delete;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4177 params.url = url;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4178 params.username = username;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4179 params.password = password;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4180
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4181 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4182 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4183
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4184
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4185
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4186 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4187 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4188 OrthancPluginImage** target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4189 const OrthancPluginImage* source;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4190 OrthancPluginPixelFormat targetFormat;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4191 } _OrthancPluginConvertPixelFormat;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4192
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4193
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4194 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4195 * @brief Change the pixel format of an image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4196 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4197 * This function creates a new image, changing the memory layout of the pixels.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4198 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4199 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4200 * @param source The source image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4201 * @param targetFormat The target pixel format.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4202 * @return The resulting image. It must be freed with OrthancPluginFreeImage().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4203 * @ingroup Images
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4204 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4205 ORTHANC_PLUGIN_INLINE OrthancPluginImage *OrthancPluginConvertPixelFormat(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4206 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4207 const OrthancPluginImage* source,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4208 OrthancPluginPixelFormat targetFormat)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4209 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4210 OrthancPluginImage* target = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4211
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4212 _OrthancPluginConvertPixelFormat params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4213 params.target = &target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4214 params.source = source;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4215 params.targetFormat = targetFormat;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4216
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4217 if (context->InvokeService(context, _OrthancPluginService_ConvertPixelFormat, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4218 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4219 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4220 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4221 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4222 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4223 return target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4224 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4225 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4226
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4227
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4228
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4229 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4230 * @brief Return the number of available fonts.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4231 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4232 * This function returns the number of fonts that are built in the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4233 * Orthanc core. These fonts can be used to draw texts on images
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4234 * through OrthancPluginDrawText().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4235 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4236 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4237 * @return The number of fonts.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4238 * @ingroup Images
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4239 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4240 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontsCount(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4241 OrthancPluginContext* context)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4242 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4243 uint32_t count = 0;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4244
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4245 _OrthancPluginReturnSingleValue params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4246 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4247 params.resultUint32 = &count;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4248
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4249 if (context->InvokeService(context, _OrthancPluginService_GetFontsCount, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4250 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4251 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4252 return 0;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4253 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4254 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4255 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4256 return count;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4257 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4258 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4259
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4260
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4261
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4262
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4263 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4264 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4265 uint32_t fontIndex; /* in */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4266 const char** name; /* out */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4267 uint32_t* size; /* out */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4268 } _OrthancPluginGetFontInfo;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4269
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4270 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4271 * @brief Return the name of a font.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4272 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4273 * This function returns the name of a font that is built in the Orthanc core.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4274 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4275 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4276 * @param fontIndex The index of the font. This value must be less than OrthancPluginGetFontsCount().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4277 * @return The font name. This is a statically-allocated string, do not free it.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4278 * @ingroup Images
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4279 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4280 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetFontName(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4281 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4282 uint32_t fontIndex)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4283 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4284 const char* result = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4285
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4286 _OrthancPluginGetFontInfo params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4287 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4288 params.name = &result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4289 params.fontIndex = fontIndex;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4290
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4291 if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4292 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4293 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4294 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4295 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4296 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4297 return result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4298 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4299 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4300
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4301
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4302 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4303 * @brief Return the size of a font.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4304 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4305 * This function returns the size of a font that is built in the Orthanc core.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4306 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4307 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4308 * @param fontIndex The index of the font. This value must be less than OrthancPluginGetFontsCount().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4309 * @return The font size.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4310 * @ingroup Images
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4311 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4312 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontSize(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4313 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4314 uint32_t fontIndex)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4315 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4316 uint32_t result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4317
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4318 _OrthancPluginGetFontInfo params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4319 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4320 params.size = &result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4321 params.fontIndex = fontIndex;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4322
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4323 if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4324 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4325 return 0;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4326 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4327 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4328 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4329 return result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4330 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4331 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4332
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4333
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4334
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4335 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4336 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4337 OrthancPluginImage* image;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4338 uint32_t fontIndex;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4339 const char* utf8Text;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4340 int32_t x;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4341 int32_t y;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4342 uint8_t r;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4343 uint8_t g;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4344 uint8_t b;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4345 } _OrthancPluginDrawText;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4346
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4347
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4348 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4349 * @brief Draw text on an image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4350 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4351 * This function draws some text on some image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4352 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4353 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4354 * @param image The image upon which to draw the text.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4355 * @param fontIndex The index of the font. This value must be less than OrthancPluginGetFontsCount().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4356 * @param utf8Text The text to be drawn, encoded as an UTF-8 zero-terminated string.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4357 * @param x The X position of the text over the image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4358 * @param y The Y position of the text over the image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4359 * @param r The value of the red color channel of the text.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4360 * @param g The value of the green color channel of the text.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4361 * @param b The value of the blue color channel of the text.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4362 * @return 0 if success, other value if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4363 * @ingroup Images
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4364 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4365 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginDrawText(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4366 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4367 OrthancPluginImage* image,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4368 uint32_t fontIndex,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4369 const char* utf8Text,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4370 int32_t x,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4371 int32_t y,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4372 uint8_t r,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4373 uint8_t g,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4374 uint8_t b)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4375 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4376 _OrthancPluginDrawText params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4377 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4378 params.image = image;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4379 params.fontIndex = fontIndex;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4380 params.utf8Text = utf8Text;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4381 params.x = x;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4382 params.y = y;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4383 params.r = r;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4384 params.g = g;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4385 params.b = b;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4386
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4387 return context->InvokeService(context, _OrthancPluginService_DrawText, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4388 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4389
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4390
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4391
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4392 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4393 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4394 OrthancPluginStorageArea* storageArea;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4395 const char* uuid;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4396 const void* content;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4397 uint64_t size;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4398 OrthancPluginContentType type;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4399 } _OrthancPluginStorageAreaCreate;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4400
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4401
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4402 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4403 * @brief Create a file inside the storage area.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4404 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4405 * This function creates a new file inside the storage area that is
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4406 * currently used by Orthanc.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4407 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4408 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4409 * @param storageArea The storage area.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4410 * @param uuid The identifier of the file to be created.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4411 * @param content The content to store in the newly created file.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4412 * @param size The size of the content.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4413 * @param type The type of the file content.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4414 * @return 0 if success, other value if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4415 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4416 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4417 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaCreate(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4418 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4419 OrthancPluginStorageArea* storageArea,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4420 const char* uuid,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4421 const void* content,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4422 uint64_t size,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4423 OrthancPluginContentType type)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4424 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4425 _OrthancPluginStorageAreaCreate params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4426 params.storageArea = storageArea;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4427 params.uuid = uuid;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4428 params.content = content;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4429 params.size = size;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4430 params.type = type;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4431
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4432 return context->InvokeService(context, _OrthancPluginService_StorageAreaCreate, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4433 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4434
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4435
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4436 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4437 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4438 OrthancPluginMemoryBuffer* target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4439 OrthancPluginStorageArea* storageArea;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4440 const char* uuid;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4441 OrthancPluginContentType type;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4442 } _OrthancPluginStorageAreaRead;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4443
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4444
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4445 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4446 * @brief Read a file from the storage area.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4447 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4448 * This function reads the content of a given file from the storage
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4449 * area that is currently used by Orthanc.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4450 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4451 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4452 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4453 * @param storageArea The storage area.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4454 * @param uuid The identifier of the file to be read.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4455 * @param type The type of the file content.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4456 * @return 0 if success, other value if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4457 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4458 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4459 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaRead(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4460 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4461 OrthancPluginMemoryBuffer* target,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4462 OrthancPluginStorageArea* storageArea,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4463 const char* uuid,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4464 OrthancPluginContentType type)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4465 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4466 _OrthancPluginStorageAreaRead params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4467 params.target = target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4468 params.storageArea = storageArea;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4469 params.uuid = uuid;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4470 params.type = type;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4471
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4472 return context->InvokeService(context, _OrthancPluginService_StorageAreaRead, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4473 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4474
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4475
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4476 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4477 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4478 OrthancPluginStorageArea* storageArea;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4479 const char* uuid;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4480 OrthancPluginContentType type;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4481 } _OrthancPluginStorageAreaRemove;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4482
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4483 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4484 * @brief Remove a file from the storage area.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4485 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4486 * This function removes a given file from the storage area that is
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4487 * currently used by Orthanc.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4488 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4489 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4490 * @param storageArea The storage area.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4491 * @param uuid The identifier of the file to be removed.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4492 * @param type The type of the file content.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4493 * @return 0 if success, other value if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4494 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4495 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4496 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaRemove(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4497 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4498 OrthancPluginStorageArea* storageArea,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4499 const char* uuid,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4500 OrthancPluginContentType type)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4501 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4502 _OrthancPluginStorageAreaRemove params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4503 params.storageArea = storageArea;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4504 params.uuid = uuid;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4505 params.type = type;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4506
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4507 return context->InvokeService(context, _OrthancPluginService_StorageAreaRemove, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4508 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4509
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4510
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4511
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4512 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4513 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4514 OrthancPluginErrorCode* target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4515 int32_t code;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4516 uint16_t httpStatus;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4517 const char* message;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4518 } _OrthancPluginRegisterErrorCode;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4519
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4520 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4521 * @brief Declare a custom error code for this plugin.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4522 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4523 * This function declares a custom error code that can be generated
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4524 * by this plugin. This declaration is used to enrich the body of
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4525 * the HTTP answer in the case of an error, and to set the proper
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4526 * HTTP status code.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4527 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4528 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4529 * @param code The error code that is internal to this plugin.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4530 * @param httpStatus The HTTP status corresponding to this error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4531 * @param message The description of the error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4532 * @return The error code that has been assigned inside the Orthanc core.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4533 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4534 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4535 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterErrorCode(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4536 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4537 int32_t code,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4538 uint16_t httpStatus,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4539 const char* message)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4540 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4541 OrthancPluginErrorCode target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4542
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4543 _OrthancPluginRegisterErrorCode params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4544 params.target = &target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4545 params.code = code;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4546 params.httpStatus = httpStatus;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4547 params.message = message;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4548
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4549 if (context->InvokeService(context, _OrthancPluginService_RegisterErrorCode, &params) == OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4550 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4551 return target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4552 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4553 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4554 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4555 /* There was an error while assigned the error. Use a generic code. */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4556 return OrthancPluginErrorCode_Plugin;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4557 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4558 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4559
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4560
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4561
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4562 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4563 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4564 uint16_t group;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4565 uint16_t element;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4566 OrthancPluginValueRepresentation vr;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4567 const char* name;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4568 uint32_t minMultiplicity;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4569 uint32_t maxMultiplicity;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4570 } _OrthancPluginRegisterDictionaryTag;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4571
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4572 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4573 * @brief Register a new tag into the DICOM dictionary.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4574 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4575 * This function declares a new public tag in the dictionary of
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4576 * DICOM tags that are known to Orthanc. This function should be
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4577 * used in the OrthancPluginInitialize() callback.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4578 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4579 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4580 * @param group The group of the tag.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4581 * @param element The element of the tag.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4582 * @param vr The value representation of the tag.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4583 * @param name The nickname of the tag.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4584 * @param minMultiplicity The minimum multiplicity of the tag (must be above 0).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4585 * @param maxMultiplicity The maximum multiplicity of the tag. A value of 0 means
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4586 * an arbitrary multiplicity ("<tt>n</tt>").
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4587 * @return 0 if success, other value if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4588 * @see OrthancPluginRegisterPrivateDictionaryTag()
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4589 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4590 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4591 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterDictionaryTag(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4592 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4593 uint16_t group,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4594 uint16_t element,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4595 OrthancPluginValueRepresentation vr,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4596 const char* name,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4597 uint32_t minMultiplicity,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4598 uint32_t maxMultiplicity)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4599 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4600 _OrthancPluginRegisterDictionaryTag params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4601 params.group = group;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4602 params.element = element;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4603 params.vr = vr;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4604 params.name = name;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4605 params.minMultiplicity = minMultiplicity;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4606 params.maxMultiplicity = maxMultiplicity;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4607
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4608 return context->InvokeService(context, _OrthancPluginService_RegisterDictionaryTag, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4609 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4610
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4611
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4612
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4613 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4614 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4615 uint16_t group;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4616 uint16_t element;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4617 OrthancPluginValueRepresentation vr;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4618 const char* name;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4619 uint32_t minMultiplicity;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4620 uint32_t maxMultiplicity;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4621 const char* privateCreator;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4622 } _OrthancPluginRegisterPrivateDictionaryTag;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4623
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4624 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4625 * @brief Register a new private tag into the DICOM dictionary.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4626 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4627 * This function declares a new private tag in the dictionary of
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4628 * DICOM tags that are known to Orthanc. This function should be
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4629 * used in the OrthancPluginInitialize() callback.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4630 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4631 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4632 * @param group The group of the tag.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4633 * @param element The element of the tag.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4634 * @param vr The value representation of the tag.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4635 * @param name The nickname of the tag.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4636 * @param minMultiplicity The minimum multiplicity of the tag (must be above 0).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4637 * @param maxMultiplicity The maximum multiplicity of the tag. A value of 0 means
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4638 * an arbitrary multiplicity ("<tt>n</tt>").
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4639 * @param privateCreator The private creator of this private tag.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4640 * @return 0 if success, other value if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4641 * @see OrthancPluginRegisterDictionaryTag()
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4642 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4643 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4644 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterPrivateDictionaryTag(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4645 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4646 uint16_t group,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4647 uint16_t element,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4648 OrthancPluginValueRepresentation vr,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4649 const char* name,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4650 uint32_t minMultiplicity,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4651 uint32_t maxMultiplicity,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4652 const char* privateCreator)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4653 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4654 _OrthancPluginRegisterPrivateDictionaryTag params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4655 params.group = group;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4656 params.element = element;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4657 params.vr = vr;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4658 params.name = name;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4659 params.minMultiplicity = minMultiplicity;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4660 params.maxMultiplicity = maxMultiplicity;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4661 params.privateCreator = privateCreator;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4662
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4663 return context->InvokeService(context, _OrthancPluginService_RegisterPrivateDictionaryTag, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4664 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4665
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4666
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4667
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4668 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4669 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4670 OrthancPluginStorageArea* storageArea;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4671 OrthancPluginResourceType level;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4672 } _OrthancPluginReconstructMainDicomTags;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4673
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4674 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4675 * @brief Reconstruct the main DICOM tags.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4676 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4677 * This function requests the Orthanc core to reconstruct the main
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4678 * DICOM tags of all the resources of the given type. This function
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4679 * can only be used as a part of the upgrade of a custom database
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4680 * back-end. A database transaction will be automatically setup.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4681 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4682 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4683 * @param storageArea The storage area.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4684 * @param level The type of the resources of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4685 * @return 0 if success, other value if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4686 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4687 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4688 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginReconstructMainDicomTags(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4689 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4690 OrthancPluginStorageArea* storageArea,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4691 OrthancPluginResourceType level)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4692 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4693 _OrthancPluginReconstructMainDicomTags params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4694 params.level = level;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4695 params.storageArea = storageArea;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4696
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4697 return context->InvokeService(context, _OrthancPluginService_ReconstructMainDicomTags, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4698 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4699
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4700
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4701 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4702 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4703 char** result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4704 const char* instanceId;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4705 const void* buffer;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4706 uint32_t size;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4707 OrthancPluginDicomToJsonFormat format;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4708 OrthancPluginDicomToJsonFlags flags;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4709 uint32_t maxStringLength;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4710 } _OrthancPluginDicomToJson;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4711
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4712
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4713 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4714 * @brief Format a DICOM memory buffer as a JSON string.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4715 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4716 * This function takes as input a memory buffer containing a DICOM
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4717 * file, and outputs a JSON string representing the tags of this
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4718 * DICOM file.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4719 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4720 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4721 * @param buffer The memory buffer containing the DICOM file.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4722 * @param size The size of the memory buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4723 * @param format The output format.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4724 * @param flags Flags governing the output.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4725 * @param maxStringLength The maximum length of a field. Too long fields will
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4726 * be output as "null". The 0 value means no maximum length.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4727 * @return The NULL value if the case of an error, or the JSON
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4728 * string. This string must be freed by OrthancPluginFreeString().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4729 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4730 * @see OrthancPluginDicomInstanceToJson
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4731 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4732 ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomBufferToJson(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4733 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4734 const void* buffer,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4735 uint32_t size,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4736 OrthancPluginDicomToJsonFormat format,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4737 OrthancPluginDicomToJsonFlags flags,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4738 uint32_t maxStringLength)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4739 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4740 char* result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4741
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4742 _OrthancPluginDicomToJson params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4743 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4744 params.result = &result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4745 params.buffer = buffer;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4746 params.size = size;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4747 params.format = format;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4748 params.flags = flags;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4749 params.maxStringLength = maxStringLength;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4750
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4751 if (context->InvokeService(context, _OrthancPluginService_DicomBufferToJson, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4752 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4753 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4754 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4755 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4756 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4757 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4758 return result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4759 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4760 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4761
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4762
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4763 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4764 * @brief Format a DICOM instance as a JSON string.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4765 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4766 * This function formats a DICOM instance that is stored in Orthanc,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4767 * and outputs a JSON string representing the tags of this DICOM
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4768 * instance.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4769 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4770 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4771 * @param instanceId The Orthanc identifier of the instance.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4772 * @param format The output format.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4773 * @param flags Flags governing the output.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4774 * @param maxStringLength The maximum length of a field. Too long fields will
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4775 * be output as "null". The 0 value means no maximum length.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4776 * @return The NULL value if the case of an error, or the JSON
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4777 * string. This string must be freed by OrthancPluginFreeString().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4778 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4779 * @see OrthancPluginDicomInstanceToJson
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4780 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4781 ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomInstanceToJson(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4782 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4783 const char* instanceId,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4784 OrthancPluginDicomToJsonFormat format,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4785 OrthancPluginDicomToJsonFlags flags,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4786 uint32_t maxStringLength)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4787 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4788 char* result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4789
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4790 _OrthancPluginDicomToJson params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4791 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4792 params.result = &result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4793 params.instanceId = instanceId;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4794 params.format = format;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4795 params.flags = flags;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4796 params.maxStringLength = maxStringLength;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4797
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4798 if (context->InvokeService(context, _OrthancPluginService_DicomInstanceToJson, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4799 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4800 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4801 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4802 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4803 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4804 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4805 return result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4806 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4807 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4808
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4809
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4810 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4811 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4812 OrthancPluginMemoryBuffer* target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4813 const char* uri;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4814 uint32_t headersCount;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4815 const char* const* headersKeys;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4816 const char* const* headersValues;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4817 int32_t afterPlugins;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4818 } _OrthancPluginRestApiGet2;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4819
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4820 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4821 * @brief Make a GET call to the Orthanc REST API, with custom HTTP headers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4822 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4823 * Make a GET call to the Orthanc REST API with extended
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4824 * parameters. The result to the query is stored into a newly
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4825 * allocated memory buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4826 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4827 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4828 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4829 * @param uri The URI in the built-in Orthanc API.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4830 * @param headersCount The number of HTTP headers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4831 * @param headersKeys Array containing the keys of the HTTP headers (can be <tt>NULL</tt> if no header).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4832 * @param headersValues Array containing the values of the HTTP headers (can be <tt>NULL</tt> if no header).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4833 * @param afterPlugins If 0, the built-in API of Orthanc is used.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4834 * If 1, the API is tainted by the plugins.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4835 * @return 0 if success, or the error code if failure.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4836 * @see OrthancPluginRestApiGet, OrthancPluginRestApiGetAfterPlugins
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4837 * @ingroup Orthanc
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4838 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4839 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGet2(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4840 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4841 OrthancPluginMemoryBuffer* target,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4842 const char* uri,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4843 uint32_t headersCount,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4844 const char* const* headersKeys,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4845 const char* const* headersValues,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4846 int32_t afterPlugins)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4847 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4848 _OrthancPluginRestApiGet2 params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4849 params.target = target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4850 params.uri = uri;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4851 params.headersCount = headersCount;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4852 params.headersKeys = headersKeys;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4853 params.headersValues = headersValues;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4854 params.afterPlugins = afterPlugins;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4855
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4856 return context->InvokeService(context, _OrthancPluginService_RestApiGet2, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4857 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4858
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4859
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4860
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4861 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4862 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4863 OrthancPluginWorklistCallback callback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4864 } _OrthancPluginWorklistCallback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4865
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4866 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4867 * @brief Register a callback to handle modality worklists requests.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4868 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4869 * This function registers a callback to handle C-Find SCP requests
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4870 * on modality worklists.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4871 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4872 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4873 * @param callback The callback.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4874 * @return 0 if success, other value if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4875 * @ingroup DicomCallbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4876 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4877 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterWorklistCallback(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4878 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4879 OrthancPluginWorklistCallback callback)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4880 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4881 _OrthancPluginWorklistCallback params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4882 params.callback = callback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4883
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4884 return context->InvokeService(context, _OrthancPluginService_RegisterWorklistCallback, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4885 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4886
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4887
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4888
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4889 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4890 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4891 OrthancPluginWorklistAnswers* answers;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4892 const OrthancPluginWorklistQuery* query;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4893 const void* dicom;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4894 uint32_t size;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4895 } _OrthancPluginWorklistAnswersOperation;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4896
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4897 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4898 * @brief Add one answer to some modality worklist request.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4899 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4900 * This function adds one worklist (encoded as a DICOM file) to the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4901 * set of answers corresponding to some C-Find SCP request against
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4902 * modality worklists.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4903 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4904 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4905 * @param answers The set of answers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4906 * @param query The worklist query, as received by the callback.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4907 * @param dicom The worklist to answer, encoded as a DICOM file.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4908 * @param size The size of the DICOM file.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4909 * @return 0 if success, other value if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4910 * @ingroup DicomCallbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4911 * @see OrthancPluginCreateDicom()
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4912 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4913 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistAddAnswer(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4914 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4915 OrthancPluginWorklistAnswers* answers,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4916 const OrthancPluginWorklistQuery* query,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4917 const void* dicom,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4918 uint32_t size)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4919 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4920 _OrthancPluginWorklistAnswersOperation params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4921 params.answers = answers;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4922 params.query = query;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4923 params.dicom = dicom;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4924 params.size = size;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4925
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4926 return context->InvokeService(context, _OrthancPluginService_WorklistAddAnswer, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4927 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4928
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4929
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4930 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4931 * @brief Mark the set of worklist answers as incomplete.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4932 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4933 * This function marks as incomplete the set of answers
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4934 * corresponding to some C-Find SCP request against modality
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4935 * worklists. This must be used if canceling the handling of a
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4936 * request when too many answers are to be returned.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4937 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4938 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4939 * @param answers The set of answers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4940 * @return 0 if success, other value if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4941 * @ingroup DicomCallbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4942 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4943 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistMarkIncomplete(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4944 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4945 OrthancPluginWorklistAnswers* answers)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4946 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4947 _OrthancPluginWorklistAnswersOperation params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4948 params.answers = answers;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4949 params.query = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4950 params.dicom = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4951 params.size = 0;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4952
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4953 return context->InvokeService(context, _OrthancPluginService_WorklistMarkIncomplete, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4954 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4955
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4956
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4957 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4958 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4959 const OrthancPluginWorklistQuery* query;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4960 const void* dicom;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4961 uint32_t size;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4962 int32_t* isMatch;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4963 OrthancPluginMemoryBuffer* target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4964 } _OrthancPluginWorklistQueryOperation;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4965
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4966 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4967 * @brief Test whether a worklist matches the query.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4968 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4969 * This function checks whether one worklist (encoded as a DICOM
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4970 * file) matches the C-Find SCP query against modality
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4971 * worklists. This function must be called before adding the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4972 * worklist as an answer through OrthancPluginWorklistAddAnswer().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4973 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4974 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4975 * @param query The worklist query, as received by the callback.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4976 * @param dicom The worklist to answer, encoded as a DICOM file.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4977 * @param size The size of the DICOM file.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4978 * @return 1 if the worklist matches the query, 0 otherwise.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4979 * @ingroup DicomCallbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4980 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4981 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginWorklistIsMatch(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4982 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4983 const OrthancPluginWorklistQuery* query,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4984 const void* dicom,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4985 uint32_t size)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4986 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4987 int32_t isMatch = 0;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4988
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4989 _OrthancPluginWorklistQueryOperation params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4990 params.query = query;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4991 params.dicom = dicom;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4992 params.size = size;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4993 params.isMatch = &isMatch;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4994 params.target = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4995
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4996 if (context->InvokeService(context, _OrthancPluginService_WorklistIsMatch, &params) == OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4997 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4998 return isMatch;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4999 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5000 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5001 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5002 /* Error: Assume non-match */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5003 return 0;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5004 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5005 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5006
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5007
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5008 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5009 * @brief Retrieve the worklist query as a DICOM file.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5010 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5011 * This function retrieves the DICOM file that underlies a C-Find
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5012 * SCP query against modality worklists.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5013 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5014 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5015 * @param target Memory buffer where to store the DICOM file. It must be freed with OrthancPluginFreeMemoryBuffer().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5016 * @param query The worklist query, as received by the callback.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5017 * @return 0 if success, other value if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5018 * @ingroup DicomCallbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5019 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5020 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistGetDicomQuery(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5021 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5022 OrthancPluginMemoryBuffer* target,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5023 const OrthancPluginWorklistQuery* query)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5024 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5025 _OrthancPluginWorklistQueryOperation params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5026 params.query = query;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5027 params.dicom = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5028 params.size = 0;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5029 params.isMatch = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5030 params.target = target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5031
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5032 return context->InvokeService(context, _OrthancPluginService_WorklistGetDicomQuery, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5033 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5034
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5035
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5036 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5037 * @brief Get the origin of a DICOM file.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5038 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5039 * This function returns the origin of a DICOM instance that has been received by Orthanc.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5040 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5041 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5042 * @param instance The instance of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5043 * @return The origin of the instance.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5044 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5045 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5046 ORTHANC_PLUGIN_INLINE OrthancPluginInstanceOrigin OrthancPluginGetInstanceOrigin(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5047 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5048 OrthancPluginDicomInstance* instance)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5049 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5050 OrthancPluginInstanceOrigin origin;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5051
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5052 _OrthancPluginAccessDicomInstance params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5053 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5054 params.resultOrigin = &origin;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5055 params.instance = instance;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5056
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5057 if (context->InvokeService(context, _OrthancPluginService_GetInstanceOrigin, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5058 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5059 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5060 return OrthancPluginInstanceOrigin_Unknown;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5061 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5062 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5063 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5064 return origin;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5065 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5066 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5067
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5068
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5069 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5070 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5071 OrthancPluginMemoryBuffer* target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5072 const char* json;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5073 const OrthancPluginImage* pixelData;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5074 OrthancPluginCreateDicomFlags flags;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5075 } _OrthancPluginCreateDicom;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5076
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5077 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5078 * @brief Create a DICOM instance from a JSON string and an image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5079 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5080 * This function takes as input a string containing a JSON file
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5081 * describing the content of a DICOM instance. As an output, it
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5082 * writes the corresponding DICOM instance to a newly allocated
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5083 * memory buffer. Additionally, an image to be encoded within the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5084 * DICOM instance can also be provided.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5085 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5086 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5087 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5088 * @param json The input JSON file.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5089 * @param pixelData The image. Can be NULL, if the pixel data is encoded inside the JSON with the data URI scheme.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5090 * @param flags Flags governing the output.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5091 * @return 0 if success, other value if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5092 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5093 * @see OrthancPluginDicomBufferToJson
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5094 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5095 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCreateDicom(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5096 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5097 OrthancPluginMemoryBuffer* target,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5098 const char* json,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5099 const OrthancPluginImage* pixelData,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5100 OrthancPluginCreateDicomFlags flags)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5101 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5102 _OrthancPluginCreateDicom params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5103 params.target = target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5104 params.json = json;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5105 params.pixelData = pixelData;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5106 params.flags = flags;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5107
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5108 return context->InvokeService(context, _OrthancPluginService_CreateDicom, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5109 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5110
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5111
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5112 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5113 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5114 OrthancPluginDecodeImageCallback callback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5115 } _OrthancPluginDecodeImageCallback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5116
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5117 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5118 * @brief Register a callback to handle the decoding of DICOM images.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5119 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5120 * This function registers a custom callback to the decoding of
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5121 * DICOM images, replacing the built-in decoder of Orthanc.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5122 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5123 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5124 * @param callback The callback.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5125 * @return 0 if success, other value if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5126 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5127 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5128 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterDecodeImageCallback(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5129 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5130 OrthancPluginDecodeImageCallback callback)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5131 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5132 _OrthancPluginDecodeImageCallback params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5133 params.callback = callback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5134
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5135 return context->InvokeService(context, _OrthancPluginService_RegisterDecodeImageCallback, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5136 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5137
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5138
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5139
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5140 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5141 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5142 OrthancPluginImage** target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5143 OrthancPluginPixelFormat format;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5144 uint32_t width;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5145 uint32_t height;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5146 uint32_t pitch;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5147 void* buffer;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5148 const void* constBuffer;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5149 uint32_t bufferSize;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5150 uint32_t frameIndex;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5151 } _OrthancPluginCreateImage;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5152
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5153
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5154 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5155 * @brief Create an image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5156 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5157 * This function creates an image of given size and format.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5158 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5159 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5160 * @param format The format of the pixels.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5161 * @param width The width of the image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5162 * @param height The height of the image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5163 * @return The newly allocated image. It must be freed with OrthancPluginFreeImage().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5164 * @ingroup Images
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5165 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5166 ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginCreateImage(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5167 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5168 OrthancPluginPixelFormat format,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5169 uint32_t width,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5170 uint32_t height)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5171 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5172 OrthancPluginImage* target = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5173
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5174 _OrthancPluginCreateImage params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5175 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5176 params.target = &target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5177 params.format = format;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5178 params.width = width;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5179 params.height = height;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5180
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5181 if (context->InvokeService(context, _OrthancPluginService_CreateImage, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5182 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5183 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5184 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5185 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5186 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5187 return target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5188 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5189 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5190
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5191
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5192 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5193 * @brief Create an image pointing to a memory buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5194 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5195 * This function creates an image whose content points to a memory
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5196 * buffer managed by the plugin. Note that the buffer is directly
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5197 * accessed, no memory is allocated and no data is copied.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5198 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5199 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5200 * @param format The format of the pixels.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5201 * @param width The width of the image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5202 * @param height The height of the image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5203 * @param pitch The pitch of the image (i.e. the number of bytes
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5204 * between 2 successive lines of the image in the memory buffer).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5205 * @param buffer The memory buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5206 * @return The newly allocated image. It must be freed with OrthancPluginFreeImage().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5207 * @ingroup Images
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5208 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5209 ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginCreateImageAccessor(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5210 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5211 OrthancPluginPixelFormat format,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5212 uint32_t width,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5213 uint32_t height,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5214 uint32_t pitch,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5215 void* buffer)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5216 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5217 OrthancPluginImage* target = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5218
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5219 _OrthancPluginCreateImage params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5220 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5221 params.target = &target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5222 params.format = format;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5223 params.width = width;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5224 params.height = height;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5225 params.pitch = pitch;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5226 params.buffer = buffer;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5227
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5228 if (context->InvokeService(context, _OrthancPluginService_CreateImageAccessor, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5229 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5230 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5231 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5232 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5233 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5234 return target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5235 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5236 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5237
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5238
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5239
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5240 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5241 * @brief Decode one frame from a DICOM instance.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5242 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5243 * This function decodes one frame of a DICOM image that is stored
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5244 * in a memory buffer. This function will give the same result as
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5245 * OrthancPluginUncompressImage() for single-frame DICOM images.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5246 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5247 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5248 * @param buffer Pointer to a memory buffer containing the DICOM image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5249 * @param bufferSize Size of the memory buffer containing the DICOM image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5250 * @param frameIndex The index of the frame of interest in a multi-frame image.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5251 * @return The uncompressed image. It must be freed with OrthancPluginFreeImage().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5252 * @ingroup Images
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5253 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5254 ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginDecodeDicomImage(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5255 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5256 const void* buffer,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5257 uint32_t bufferSize,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5258 uint32_t frameIndex)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5259 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5260 OrthancPluginImage* target = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5261
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5262 _OrthancPluginCreateImage params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5263 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5264 params.target = &target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5265 params.constBuffer = buffer;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5266 params.bufferSize = bufferSize;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5267 params.frameIndex = frameIndex;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5268
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5269 if (context->InvokeService(context, _OrthancPluginService_DecodeDicomImage, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5270 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5271 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5272 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5273 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5274 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5275 return target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5276 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5277 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5278
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5279
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5280
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5281 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5282 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5283 char** result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5284 const void* buffer;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5285 uint32_t size;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5286 } _OrthancPluginComputeHash;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5287
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5288 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5289 * @brief Compute an MD5 hash.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5290 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5291 * This functions computes the MD5 cryptographic hash of the given memory buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5292 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5293 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5294 * @param buffer The source memory buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5295 * @param size The size in bytes of the source buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5296 * @return The NULL value in case of error, or a string containing the cryptographic hash.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5297 * This string must be freed by OrthancPluginFreeString().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5298 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5299 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5300 ORTHANC_PLUGIN_INLINE char* OrthancPluginComputeMd5(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5301 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5302 const void* buffer,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5303 uint32_t size)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5304 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5305 char* result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5306
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5307 _OrthancPluginComputeHash params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5308 params.result = &result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5309 params.buffer = buffer;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5310 params.size = size;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5311
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5312 if (context->InvokeService(context, _OrthancPluginService_ComputeMd5, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5313 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5314 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5315 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5316 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5317 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5318 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5319 return result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5320 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5321 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5322
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5323
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5324 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5325 * @brief Compute a SHA-1 hash.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5326 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5327 * This functions computes the SHA-1 cryptographic hash of the given memory buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5328 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5329 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5330 * @param buffer The source memory buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5331 * @param size The size in bytes of the source buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5332 * @return The NULL value in case of error, or a string containing the cryptographic hash.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5333 * This string must be freed by OrthancPluginFreeString().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5334 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5335 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5336 ORTHANC_PLUGIN_INLINE char* OrthancPluginComputeSha1(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5337 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5338 const void* buffer,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5339 uint32_t size)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5340 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5341 char* result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5342
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5343 _OrthancPluginComputeHash params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5344 params.result = &result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5345 params.buffer = buffer;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5346 params.size = size;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5347
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5348 if (context->InvokeService(context, _OrthancPluginService_ComputeSha1, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5349 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5350 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5351 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5352 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5353 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5354 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5355 return result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5356 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5357 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5358
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5359
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5360
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5361 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5362 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5363 OrthancPluginDictionaryEntry* target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5364 const char* name;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5365 } _OrthancPluginLookupDictionary;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5366
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5367 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5368 * @brief Get information about the given DICOM tag.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5369 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5370 * This functions makes a lookup in the dictionary of DICOM tags
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5371 * that are known to Orthanc, and returns information about this
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5372 * tag. The tag can be specified using its human-readable name
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5373 * (e.g. "PatientName") or a set of two hexadecimal numbers
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5374 * (e.g. "0010-0020").
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5375 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5376 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5377 * @param target Where to store the information about the tag.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5378 * @param name The name of the DICOM tag.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5379 * @return 0 if success, other value if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5380 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5381 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5382 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginLookupDictionary(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5383 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5384 OrthancPluginDictionaryEntry* target,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5385 const char* name)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5386 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5387 _OrthancPluginLookupDictionary params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5388 params.target = target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5389 params.name = name;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5390 return context->InvokeService(context, _OrthancPluginService_LookupDictionary, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5391 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5392
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5393
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5394
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5395 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5396 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5397 OrthancPluginRestOutput* output;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5398 const char* answer;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5399 uint32_t answerSize;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5400 uint32_t headersCount;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5401 const char* const* headersKeys;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5402 const char* const* headersValues;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5403 } _OrthancPluginSendMultipartItem2;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5404
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5405 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5406 * @brief Send an item as a part of some HTTP multipart answer, with custom headers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5407 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5408 * This function sends an item as a part of some HTTP multipart
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5409 * answer that was initiated by OrthancPluginStartMultipartAnswer(). In addition to
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5410 * OrthancPluginSendMultipartItem(), this function will set HTTP header associated
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5411 * with the item.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5412 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5413 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5414 * @param output The HTTP connection to the client application.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5415 * @param answer Pointer to the memory buffer containing the item.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5416 * @param answerSize Number of bytes of the item.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5417 * @param headersCount The number of HTTP headers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5418 * @param headersKeys Array containing the keys of the HTTP headers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5419 * @param headersValues Array containing the values of the HTTP headers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5420 * @return 0 if success, or the error code if failure (this notably happens
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5421 * if the connection is closed by the client).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5422 * @see OrthancPluginSendMultipartItem()
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5423 * @ingroup REST
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5424 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5425 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSendMultipartItem2(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5426 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5427 OrthancPluginRestOutput* output,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5428 const char* answer,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5429 uint32_t answerSize,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5430 uint32_t headersCount,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5431 const char* const* headersKeys,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5432 const char* const* headersValues)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5433 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5434 _OrthancPluginSendMultipartItem2 params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5435 params.output = output;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5436 params.answer = answer;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5437 params.answerSize = answerSize;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5438 params.headersCount = headersCount;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5439 params.headersKeys = headersKeys;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5440 params.headersValues = headersValues;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5441
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5442 return context->InvokeService(context, _OrthancPluginService_SendMultipartItem2, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5443 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5444
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5445
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5446 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5447 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5448 OrthancPluginIncomingHttpRequestFilter callback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5449 } _OrthancPluginIncomingHttpRequestFilter;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5450
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5451 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5452 * @brief Register a callback to filter incoming HTTP requests.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5453 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5454 * This function registers a custom callback to filter incoming HTTP/REST
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5455 * requests received by the HTTP server of Orthanc.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5456 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5457 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5458 * @param callback The callback.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5459 * @return 0 if success, other value if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5460 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5461 * @deprecated Please instead use OrthancPluginRegisterIncomingHttpRequestFilter2()
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5462 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5463 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5464 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5465 OrthancPluginIncomingHttpRequestFilter callback)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5466 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5467 _OrthancPluginIncomingHttpRequestFilter params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5468 params.callback = callback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5469
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5470 return context->InvokeService(context, _OrthancPluginService_RegisterIncomingHttpRequestFilter, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5471 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5472
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5473
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5474
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5475 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5476 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5477 OrthancPluginMemoryBuffer* answerBody;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5478 OrthancPluginMemoryBuffer* answerHeaders;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5479 uint16_t* httpStatus;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5480 OrthancPluginHttpMethod method;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5481 const char* url;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5482 uint32_t headersCount;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5483 const char* const* headersKeys;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5484 const char* const* headersValues;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5485 const char* body;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5486 uint32_t bodySize;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5487 const char* username;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5488 const char* password;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5489 uint32_t timeout;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5490 const char* certificateFile;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5491 const char* certificateKeyFile;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5492 const char* certificateKeyPassword;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5493 uint8_t pkcs11;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5494 } _OrthancPluginCallHttpClient2;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5495
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5496
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5497
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5498 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5499 * @brief Issue a HTTP call with full flexibility.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5500 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5501 * Make a HTTP call to the given URL. The result to the query is
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5502 * stored into a newly allocated memory buffer. The HTTP request
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5503 * will be done accordingly to the global configuration of Orthanc
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5504 * (in particular, the options "HttpProxy", "HttpTimeout",
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5505 * "HttpsVerifyPeers", "HttpsCACertificates", and "Pkcs11" will be
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5506 * taken into account).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5507 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5508 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5509 * @param answerBody The target memory buffer (out argument).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5510 * It must be freed with OrthancPluginFreeMemoryBuffer().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5511 * @param answerHeaders The target memory buffer for the HTTP headers in the answers (out argument).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5512 * The answer headers are formatted as a JSON object (associative array).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5513 * The buffer must be freed with OrthancPluginFreeMemoryBuffer().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5514 * This argument can be set to NULL if the plugin has no interest in the HTTP headers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5515 * @param httpStatus The HTTP status after the execution of the request (out argument).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5516 * @param method HTTP method to be used.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5517 * @param url The URL of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5518 * @param headersCount The number of HTTP headers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5519 * @param headersKeys Array containing the keys of the HTTP headers (can be <tt>NULL</tt> if no header).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5520 * @param headersValues Array containing the values of the HTTP headers (can be <tt>NULL</tt> if no header).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5521 * @param username The username (can be <tt>NULL</tt> if no password protection).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5522 * @param password The password (can be <tt>NULL</tt> if no password protection).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5523 * @param body The HTTP body for a POST or PUT request.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5524 * @param bodySize The size of the body.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5525 * @param timeout Timeout in seconds (0 for default timeout).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5526 * @param certificateFile Path to the client certificate for HTTPS, in PEM format
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5527 * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5528 * @param certificateKeyFile Path to the key of the client certificate for HTTPS, in PEM format
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5529 * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5530 * @param certificateKeyPassword Password to unlock the key of the client certificate
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5531 * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5532 * @param pkcs11 Enable PKCS#11 client authentication for hardware security modules and smart cards.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5533 * @return 0 if success, or the error code if failure.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5534 * @see OrthancPluginCallPeerApi()
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5535 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5536 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpClient(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5537 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5538 OrthancPluginMemoryBuffer* answerBody,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5539 OrthancPluginMemoryBuffer* answerHeaders,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5540 uint16_t* httpStatus,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5541 OrthancPluginHttpMethod method,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5542 const char* url,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5543 uint32_t headersCount,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5544 const char* const* headersKeys,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5545 const char* const* headersValues,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5546 const char* body,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5547 uint32_t bodySize,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5548 const char* username,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5549 const char* password,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5550 uint32_t timeout,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5551 const char* certificateFile,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5552 const char* certificateKeyFile,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5553 const char* certificateKeyPassword,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5554 uint8_t pkcs11)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5555 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5556 _OrthancPluginCallHttpClient2 params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5557 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5558
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5559 params.answerBody = answerBody;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5560 params.answerHeaders = answerHeaders;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5561 params.httpStatus = httpStatus;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5562 params.method = method;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5563 params.url = url;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5564 params.headersCount = headersCount;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5565 params.headersKeys = headersKeys;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5566 params.headersValues = headersValues;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5567 params.body = body;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5568 params.bodySize = bodySize;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5569 params.username = username;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5570 params.password = password;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5571 params.timeout = timeout;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5572 params.certificateFile = certificateFile;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5573 params.certificateKeyFile = certificateKeyFile;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5574 params.certificateKeyPassword = certificateKeyPassword;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5575 params.pkcs11 = pkcs11;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5576
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5577 return context->InvokeService(context, _OrthancPluginService_CallHttpClient2, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5578 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5579
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5580
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5581 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5582 * @brief Generate an UUID.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5583 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5584 * Generate a random GUID/UUID (globally unique identifier).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5585 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5586 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5587 * @return NULL in the case of an error, or a newly allocated string
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5588 * containing the UUID. This string must be freed by OrthancPluginFreeString().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5589 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5590 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5591 ORTHANC_PLUGIN_INLINE char* OrthancPluginGenerateUuid(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5592 OrthancPluginContext* context)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5593 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5594 char* result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5595
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5596 _OrthancPluginRetrieveDynamicString params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5597 params.result = &result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5598 params.argument = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5599
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5600 if (context->InvokeService(context, _OrthancPluginService_GenerateUuid, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5601 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5602 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5603 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5604 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5605 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5606 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5607 return result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5608 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5609 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5610
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5611
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5612
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5613
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5614 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5615 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5616 OrthancPluginFindCallback callback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5617 } _OrthancPluginFindCallback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5618
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5619 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5620 * @brief Register a callback to handle C-Find requests.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5621 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5622 * This function registers a callback to handle C-Find SCP requests
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5623 * that are not related to modality worklists.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5624 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5625 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5626 * @param callback The callback.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5627 * @return 0 if success, other value if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5628 * @ingroup DicomCallbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5629 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5630 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterFindCallback(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5631 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5632 OrthancPluginFindCallback callback)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5633 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5634 _OrthancPluginFindCallback params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5635 params.callback = callback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5636
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5637 return context->InvokeService(context, _OrthancPluginService_RegisterFindCallback, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5638 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5639
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5640
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5641 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5642 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5643 OrthancPluginFindAnswers *answers;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5644 const OrthancPluginFindQuery *query;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5645 const void *dicom;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5646 uint32_t size;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5647 uint32_t index;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5648 uint32_t *resultUint32;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5649 uint16_t *resultGroup;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5650 uint16_t *resultElement;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5651 char **resultString;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5652 } _OrthancPluginFindOperation;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5653
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5654 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5655 * @brief Add one answer to some C-Find request.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5656 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5657 * This function adds one answer (encoded as a DICOM file) to the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5658 * set of answers corresponding to some C-Find SCP request that is
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5659 * not related to modality worklists.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5660 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5661 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5662 * @param answers The set of answers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5663 * @param dicom The answer to be added, encoded as a DICOM file.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5664 * @param size The size of the DICOM file.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5665 * @return 0 if success, other value if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5666 * @ingroup DicomCallbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5667 * @see OrthancPluginCreateDicom()
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5668 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5669 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginFindAddAnswer(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5670 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5671 OrthancPluginFindAnswers* answers,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5672 const void* dicom,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5673 uint32_t size)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5674 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5675 _OrthancPluginFindOperation params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5676 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5677 params.answers = answers;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5678 params.dicom = dicom;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5679 params.size = size;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5680
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5681 return context->InvokeService(context, _OrthancPluginService_FindAddAnswer, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5682 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5683
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5684
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5685 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5686 * @brief Mark the set of C-Find answers as incomplete.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5687 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5688 * This function marks as incomplete the set of answers
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5689 * corresponding to some C-Find SCP request that is not related to
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5690 * modality worklists. This must be used if canceling the handling
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5691 * of a request when too many answers are to be returned.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5692 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5693 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5694 * @param answers The set of answers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5695 * @return 0 if success, other value if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5696 * @ingroup DicomCallbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5697 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5698 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginFindMarkIncomplete(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5699 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5700 OrthancPluginFindAnswers* answers)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5701 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5702 _OrthancPluginFindOperation params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5703 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5704 params.answers = answers;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5705
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5706 return context->InvokeService(context, _OrthancPluginService_FindMarkIncomplete, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5707 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5708
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5709
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5710
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5711 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5712 * @brief Get the number of tags in a C-Find query.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5713 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5714 * This function returns the number of tags that are contained in
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5715 * the given C-Find query.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5716 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5717 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5718 * @param query The C-Find query.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5719 * @return The number of tags.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5720 * @ingroup DicomCallbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5721 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5722 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFindQuerySize(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5723 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5724 const OrthancPluginFindQuery* query)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5725 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5726 uint32_t count = 0;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5727
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5728 _OrthancPluginFindOperation params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5729 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5730 params.query = query;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5731 params.resultUint32 = &count;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5732
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5733 if (context->InvokeService(context, _OrthancPluginService_GetFindQuerySize, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5734 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5735 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5736 return 0;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5737 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5738 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5739 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5740 return count;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5741 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5742 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5743
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5744
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5745 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5746 * @brief Get one tag in a C-Find query.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5747 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5748 * This function returns the group and the element of one DICOM tag
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5749 * in the given C-Find query.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5750 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5751 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5752 * @param group The group of the tag (output).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5753 * @param element The element of the tag (output).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5754 * @param query The C-Find query.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5755 * @param index The index of the tag of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5756 * @return 0 if success, other value if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5757 * @ingroup DicomCallbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5758 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5759 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginGetFindQueryTag(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5760 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5761 uint16_t* group,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5762 uint16_t* element,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5763 const OrthancPluginFindQuery* query,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5764 uint32_t index)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5765 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5766 _OrthancPluginFindOperation params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5767 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5768 params.query = query;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5769 params.index = index;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5770 params.resultGroup = group;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5771 params.resultElement = element;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5772
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5773 return context->InvokeService(context, _OrthancPluginService_GetFindQueryTag, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5774 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5775
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5776
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5777 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5778 * @brief Get the symbolic name of one tag in a C-Find query.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5779 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5780 * This function returns the symbolic name of one DICOM tag in the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5781 * given C-Find query.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5782 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5783 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5784 * @param query The C-Find query.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5785 * @param index The index of the tag of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5786 * @return The NULL value in case of error, or a string containing the name of the tag.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5787 * @return 0 if success, other value if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5788 * @ingroup DicomCallbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5789 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5790 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetFindQueryTagName(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5791 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5792 const OrthancPluginFindQuery* query,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5793 uint32_t index)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5794 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5795 char* result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5796
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5797 _OrthancPluginFindOperation params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5798 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5799 params.query = query;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5800 params.index = index;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5801 params.resultString = &result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5802
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5803 if (context->InvokeService(context, _OrthancPluginService_GetFindQueryTagName, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5804 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5805 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5806 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5807 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5808 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5809 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5810 return result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5811 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5812 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5813
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5814
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5815 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5816 * @brief Get the value associated with one tag in a C-Find query.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5817 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5818 * This function returns the value associated with one tag in the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5819 * given C-Find query.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5820 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5821 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5822 * @param query The C-Find query.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5823 * @param index The index of the tag of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5824 * @return The NULL value in case of error, or a string containing the value of the tag.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5825 * @return 0 if success, other value if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5826 * @ingroup DicomCallbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5827 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5828 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetFindQueryValue(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5829 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5830 const OrthancPluginFindQuery* query,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5831 uint32_t index)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5832 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5833 char* result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5834
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5835 _OrthancPluginFindOperation params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5836 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5837 params.query = query;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5838 params.index = index;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5839 params.resultString = &result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5840
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5841 if (context->InvokeService(context, _OrthancPluginService_GetFindQueryValue, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5842 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5843 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5844 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5845 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5846 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5847 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5848 return result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5849 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5850 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5851
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5852
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5853
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5854
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5855 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5856 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5857 OrthancPluginMoveCallback callback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5858 OrthancPluginGetMoveSize getMoveSize;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5859 OrthancPluginApplyMove applyMove;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5860 OrthancPluginFreeMove freeMove;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5861 } _OrthancPluginMoveCallback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5862
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5863 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5864 * @brief Register a callback to handle C-Move requests.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5865 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5866 * This function registers a callback to handle C-Move SCP requests.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5867 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5868 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5869 * @param callback The main callback.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5870 * @param getMoveSize Callback to read the number of C-Move suboperations.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5871 * @param applyMove Callback to apply one C-Move suboperations.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5872 * @param freeMove Callback to free the C-Move driver.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5873 * @return 0 if success, other value if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5874 * @ingroup DicomCallbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5875 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5876 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterMoveCallback(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5877 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5878 OrthancPluginMoveCallback callback,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5879 OrthancPluginGetMoveSize getMoveSize,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5880 OrthancPluginApplyMove applyMove,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5881 OrthancPluginFreeMove freeMove)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5882 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5883 _OrthancPluginMoveCallback params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5884 params.callback = callback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5885 params.getMoveSize = getMoveSize;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5886 params.applyMove = applyMove;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5887 params.freeMove = freeMove;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5888
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5889 return context->InvokeService(context, _OrthancPluginService_RegisterMoveCallback, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5890 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5891
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5892
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5893
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5894 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5895 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5896 OrthancPluginFindMatcher** target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5897 const void* query;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5898 uint32_t size;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5899 } _OrthancPluginCreateFindMatcher;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5900
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5901
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5902 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5903 * @brief Create a C-Find matcher.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5904 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5905 * This function creates a "matcher" object that can be used to
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5906 * check whether a DICOM instance matches a C-Find query. The C-Find
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5907 * query must be expressed as a DICOM buffer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5908 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5909 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5910 * @param query The C-Find DICOM query.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5911 * @param size The size of the DICOM query.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5912 * @return The newly allocated matcher. It must be freed with OrthancPluginFreeFindMatcher().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5913 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5914 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5915 ORTHANC_PLUGIN_INLINE OrthancPluginFindMatcher* OrthancPluginCreateFindMatcher(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5916 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5917 const void* query,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5918 uint32_t size)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5919 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5920 OrthancPluginFindMatcher* target = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5921
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5922 _OrthancPluginCreateFindMatcher params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5923 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5924 params.target = &target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5925 params.query = query;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5926 params.size = size;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5927
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5928 if (context->InvokeService(context, _OrthancPluginService_CreateFindMatcher, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5929 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5930 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5931 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5932 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5933 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5934 return target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5935 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5936 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5937
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5938
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5939 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5940 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5941 OrthancPluginFindMatcher* matcher;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5942 } _OrthancPluginFreeFindMatcher;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5943
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5944 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5945 * @brief Free a C-Find matcher.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5946 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5947 * This function frees a matcher that was created using OrthancPluginCreateFindMatcher().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5948 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5949 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5950 * @param matcher The matcher of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5951 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5952 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5953 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeFindMatcher(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5954 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5955 OrthancPluginFindMatcher* matcher)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5956 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5957 _OrthancPluginFreeFindMatcher params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5958 params.matcher = matcher;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5959
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5960 context->InvokeService(context, _OrthancPluginService_FreeFindMatcher, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5961 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5962
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5963
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5964 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5965 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5966 const OrthancPluginFindMatcher* matcher;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5967 const void* dicom;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5968 uint32_t size;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5969 int32_t* isMatch;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5970 } _OrthancPluginFindMatcherIsMatch;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5971
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5972 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5973 * @brief Test whether a DICOM instance matches a C-Find query.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5974 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5975 * This function checks whether one DICOM instance matches C-Find
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5976 * matcher that was previously allocated using
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5977 * OrthancPluginCreateFindMatcher().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5978 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5979 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5980 * @param matcher The matcher of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5981 * @param dicom The DICOM instance to be matched.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5982 * @param size The size of the DICOM instance.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5983 * @return 1 if the DICOM instance matches the query, 0 otherwise.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5984 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5985 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5986 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginFindMatcherIsMatch(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5987 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5988 const OrthancPluginFindMatcher* matcher,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5989 const void* dicom,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5990 uint32_t size)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5991 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5992 int32_t isMatch = 0;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5993
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5994 _OrthancPluginFindMatcherIsMatch params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5995 params.matcher = matcher;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5996 params.dicom = dicom;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5997 params.size = size;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5998 params.isMatch = &isMatch;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5999
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6000 if (context->InvokeService(context, _OrthancPluginService_FindMatcherIsMatch, &params) == OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6001 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6002 return isMatch;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6003 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6004 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6005 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6006 /* Error: Assume non-match */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6007 return 0;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6008 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6009 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6010
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6011
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6012 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6013 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6014 OrthancPluginIncomingHttpRequestFilter2 callback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6015 } _OrthancPluginIncomingHttpRequestFilter2;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6016
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6017 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6018 * @brief Register a callback to filter incoming HTTP requests.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6019 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6020 * This function registers a custom callback to filter incoming HTTP/REST
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6021 * requests received by the HTTP server of Orthanc.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6022 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6023 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6024 * @param callback The callback.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6025 * @return 0 if success, other value if error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6026 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6027 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6028 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter2(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6029 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6030 OrthancPluginIncomingHttpRequestFilter2 callback)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6031 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6032 _OrthancPluginIncomingHttpRequestFilter2 params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6033 params.callback = callback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6034
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6035 return context->InvokeService(context, _OrthancPluginService_RegisterIncomingHttpRequestFilter2, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6036 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6037
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6038
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6039
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6040 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6041 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6042 OrthancPluginPeers** peers;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6043 } _OrthancPluginGetPeers;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6044
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6045 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6046 * @brief Return the list of available Orthanc peers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6047 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6048 * This function returns the parameters of the Orthanc peers that are known to
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6049 * the Orthanc server hosting the plugin.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6050 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6051 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6052 * @return NULL if error, or a newly allocated opaque data structure containing the peers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6053 * This structure must be freed with OrthancPluginFreePeers().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6054 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6055 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6056 ORTHANC_PLUGIN_INLINE OrthancPluginPeers* OrthancPluginGetPeers(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6057 OrthancPluginContext* context)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6058 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6059 OrthancPluginPeers* peers = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6060
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6061 _OrthancPluginGetPeers params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6062 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6063 params.peers = &peers;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6064
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6065 if (context->InvokeService(context, _OrthancPluginService_GetPeers, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6066 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6067 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6068 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6069 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6070 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6071 return peers;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6072 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6073 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6074
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6075
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6076 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6077 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6078 OrthancPluginPeers* peers;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6079 } _OrthancPluginFreePeers;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6080
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6081 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6082 * @brief Free the list of available Orthanc peers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6083 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6084 * This function frees the data structure returned by OrthancPluginGetPeers().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6085 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6086 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6087 * @param peers The data structure describing the Orthanc peers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6088 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6089 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6090 ORTHANC_PLUGIN_INLINE void OrthancPluginFreePeers(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6091 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6092 OrthancPluginPeers* peers)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6093 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6094 _OrthancPluginFreePeers params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6095 params.peers = peers;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6096
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6097 context->InvokeService(context, _OrthancPluginService_FreePeers, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6098 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6099
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6100
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6101 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6102 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6103 uint32_t* target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6104 const OrthancPluginPeers* peers;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6105 } _OrthancPluginGetPeersCount;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6106
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6107 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6108 * @brief Get the number of Orthanc peers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6109 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6110 * This function returns the number of Orthanc peers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6111 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6112 * This function is thread-safe: Several threads sharing the same
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6113 * OrthancPluginPeers object can simultaneously call this function.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6114 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6115 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6116 * @param peers The data structure describing the Orthanc peers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6117 * @result The number of peers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6118 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6119 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6120 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetPeersCount(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6121 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6122 const OrthancPluginPeers* peers)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6123 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6124 uint32_t target = 0;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6125
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6126 _OrthancPluginGetPeersCount params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6127 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6128 params.target = &target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6129 params.peers = peers;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6130
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6131 if (context->InvokeService(context, _OrthancPluginService_GetPeersCount, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6132 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6133 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6134 return 0;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6135 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6136 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6137 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6138 return target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6139 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6140 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6141
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6142
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6143 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6144 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6145 const char** target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6146 const OrthancPluginPeers* peers;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6147 uint32_t peerIndex;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6148 const char* userProperty;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6149 } _OrthancPluginGetPeerProperty;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6150
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6151 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6152 * @brief Get the symbolic name of an Orthanc peer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6153 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6154 * This function returns the symbolic name of the Orthanc peer,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6155 * which corresponds to the key of the "OrthancPeers" configuration
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6156 * option of Orthanc.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6157 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6158 * This function is thread-safe: Several threads sharing the same
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6159 * OrthancPluginPeers object can simultaneously call this function.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6160 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6161 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6162 * @param peers The data structure describing the Orthanc peers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6163 * @param peerIndex The index of the peer of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6164 * This value must be lower than OrthancPluginGetPeersCount().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6165 * @result The symbolic name, or NULL in the case of an error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6166 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6167 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6168 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetPeerName(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6169 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6170 const OrthancPluginPeers* peers,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6171 uint32_t peerIndex)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6172 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6173 const char* target = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6174
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6175 _OrthancPluginGetPeerProperty params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6176 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6177 params.target = &target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6178 params.peers = peers;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6179 params.peerIndex = peerIndex;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6180 params.userProperty = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6181
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6182 if (context->InvokeService(context, _OrthancPluginService_GetPeerName, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6183 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6184 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6185 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6186 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6187 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6188 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6189 return target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6190 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6191 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6192
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6193
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6194 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6195 * @brief Get the base URL of an Orthanc peer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6196 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6197 * This function returns the base URL to the REST API of some Orthanc peer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6198 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6199 * This function is thread-safe: Several threads sharing the same
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6200 * OrthancPluginPeers object can simultaneously call this function.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6201 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6202 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6203 * @param peers The data structure describing the Orthanc peers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6204 * @param peerIndex The index of the peer of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6205 * This value must be lower than OrthancPluginGetPeersCount().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6206 * @result The URL, or NULL in the case of an error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6207 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6208 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6209 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetPeerUrl(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6210 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6211 const OrthancPluginPeers* peers,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6212 uint32_t peerIndex)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6213 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6214 const char* target = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6215
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6216 _OrthancPluginGetPeerProperty params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6217 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6218 params.target = &target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6219 params.peers = peers;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6220 params.peerIndex = peerIndex;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6221 params.userProperty = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6222
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6223 if (context->InvokeService(context, _OrthancPluginService_GetPeerUrl, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6224 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6225 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6226 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6227 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6228 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6229 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6230 return target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6231 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6232 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6233
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6234
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6235
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6236 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6237 * @brief Get some user-defined property of an Orthanc peer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6238 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6239 * This function returns some user-defined property of some Orthanc
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6240 * peer. An user-defined property is a property that is associated
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6241 * with the peer in the Orthanc configuration file, but that is not
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6242 * recognized by the Orthanc core.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6243 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6244 * This function is thread-safe: Several threads sharing the same
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6245 * OrthancPluginPeers object can simultaneously call this function.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6246 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6247 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6248 * @param peers The data structure describing the Orthanc peers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6249 * @param peerIndex The index of the peer of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6250 * This value must be lower than OrthancPluginGetPeersCount().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6251 * @param userProperty The user property of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6252 * @result The value of the user property, or NULL if it is not defined.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6253 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6254 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6255 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetPeerUserProperty(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6256 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6257 const OrthancPluginPeers* peers,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6258 uint32_t peerIndex,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6259 const char* userProperty)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6260 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6261 const char* target = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6262
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6263 _OrthancPluginGetPeerProperty params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6264 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6265 params.target = &target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6266 params.peers = peers;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6267 params.peerIndex = peerIndex;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6268 params.userProperty = userProperty;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6269
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6270 if (context->InvokeService(context, _OrthancPluginService_GetPeerUserProperty, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6271 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6272 /* No such user property */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6273 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6274 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6275 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6276 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6277 return target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6278 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6279 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6280
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6281
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6282
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6283 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6284 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6285 OrthancPluginMemoryBuffer* answerBody;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6286 OrthancPluginMemoryBuffer* answerHeaders;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6287 uint16_t* httpStatus;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6288 const OrthancPluginPeers* peers;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6289 uint32_t peerIndex;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6290 OrthancPluginHttpMethod method;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6291 const char* uri;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6292 uint32_t additionalHeadersCount;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6293 const char* const* additionalHeadersKeys;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6294 const char* const* additionalHeadersValues;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6295 const char* body;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6296 uint32_t bodySize;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6297 uint32_t timeout;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6298 } _OrthancPluginCallPeerApi;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6299
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6300 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6301 * @brief Call the REST API of an Orthanc peer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6302 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6303 * Make a REST call to the given URI in the REST API of a remote
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6304 * Orthanc peer. The result to the query is stored into a newly
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6305 * allocated memory buffer. The HTTP request will be done according
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6306 * to the "OrthancPeers" configuration option of Orthanc.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6307 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6308 * This function is thread-safe: Several threads sharing the same
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6309 * OrthancPluginPeers object can simultaneously call this function.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6310 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6311 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6312 * @param answerBody The target memory buffer (out argument).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6313 * It must be freed with OrthancPluginFreeMemoryBuffer().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6314 * @param answerHeaders The target memory buffer for the HTTP headers in the answers (out argument).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6315 * The answer headers are formatted as a JSON object (associative array).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6316 * The buffer must be freed with OrthancPluginFreeMemoryBuffer().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6317 * This argument can be set to NULL if the plugin has no interest in the HTTP headers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6318 * @param httpStatus The HTTP status after the execution of the request (out argument).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6319 * @param peers The data structure describing the Orthanc peers.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6320 * @param peerIndex The index of the peer of interest.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6321 * This value must be lower than OrthancPluginGetPeersCount().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6322 * @param method HTTP method to be used.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6323 * @param uri The URI of interest in the REST API.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6324 * @param additionalHeadersCount The number of HTTP headers to be added to the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6325 * HTTP headers provided in the global configuration of Orthanc.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6326 * @param additionalHeadersKeys Array containing the keys of the HTTP headers (can be <tt>NULL</tt> if no header).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6327 * @param additionalHeadersValues Array containing the values of the HTTP headers (can be <tt>NULL</tt> if no header).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6328 * @param body The HTTP body for a POST or PUT request.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6329 * @param bodySize The size of the body.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6330 * @param timeout Timeout in seconds (0 for default timeout).
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6331 * @return 0 if success, or the error code if failure.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6332 * @see OrthancPluginHttpClient()
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6333 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6334 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6335 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCallPeerApi(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6336 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6337 OrthancPluginMemoryBuffer* answerBody,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6338 OrthancPluginMemoryBuffer* answerHeaders,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6339 uint16_t* httpStatus,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6340 const OrthancPluginPeers* peers,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6341 uint32_t peerIndex,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6342 OrthancPluginHttpMethod method,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6343 const char* uri,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6344 uint32_t additionalHeadersCount,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6345 const char* const* additionalHeadersKeys,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6346 const char* const* additionalHeadersValues,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6347 const char* body,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6348 uint32_t bodySize,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6349 uint32_t timeout)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6350 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6351 _OrthancPluginCallPeerApi params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6352 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6353
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6354 params.answerBody = answerBody;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6355 params.answerHeaders = answerHeaders;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6356 params.httpStatus = httpStatus;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6357 params.peers = peers;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6358 params.peerIndex = peerIndex;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6359 params.method = method;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6360 params.uri = uri;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6361 params.additionalHeadersCount = additionalHeadersCount;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6362 params.additionalHeadersKeys = additionalHeadersKeys;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6363 params.additionalHeadersValues = additionalHeadersValues;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6364 params.body = body;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6365 params.bodySize = bodySize;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6366 params.timeout = timeout;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6367
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6368 return context->InvokeService(context, _OrthancPluginService_CallPeerApi, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6369 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6370
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6371
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6372
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6373
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6374
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6375 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6376 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6377 OrthancPluginJob** target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6378 void *job;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6379 OrthancPluginJobFinalize finalize;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6380 const char *type;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6381 OrthancPluginJobGetProgress getProgress;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6382 OrthancPluginJobGetContent getContent;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6383 OrthancPluginJobGetSerialized getSerialized;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6384 OrthancPluginJobStep step;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6385 OrthancPluginJobStop stop;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6386 OrthancPluginJobReset reset;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6387 } _OrthancPluginCreateJob;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6388
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6389 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6390 * @brief Create a custom job.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6391 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6392 * This function creates a custom job to be run by the jobs engine
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6393 * of Orthanc.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6394 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6395 * Orthanc starts one dedicated thread per custom job that is
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6396 * running. It is guaranteed that all the callbacks will only be
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6397 * called from this single dedicated thread, in mutual exclusion: As
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6398 * a consequence, it is *not* mandatory to protect the various
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6399 * callbacks by mutexes.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6400 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6401 * The custom job can nonetheless launch its own processing threads
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6402 * on the first call to the "step()" callback, and stop them once
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6403 * the "stop()" callback is called.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6404 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6405 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6406 * @param job The job to be executed.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6407 * @param finalize The finalization callback.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6408 * @param type The type of the job, provided to the job unserializer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6409 * See OrthancPluginRegisterJobsUnserializer().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6410 * @param getProgress The progress callback.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6411 * @param getContent The content callback.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6412 * @param getSerialized The serialization callback.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6413 * @param step The callback to execute the individual steps of the job.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6414 * @param stop The callback that is invoked once the job leaves the "running" state.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6415 * @param reset The callback that is invoked if a stopped job is started again.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6416 * @return The newly allocated job. It must be freed with OrthancPluginFreeJob(),
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6417 * as long as it is not submitted with OrthancPluginSubmitJob().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6418 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6419 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6420 ORTHANC_PLUGIN_INLINE OrthancPluginJob *OrthancPluginCreateJob(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6421 OrthancPluginContext *context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6422 void *job,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6423 OrthancPluginJobFinalize finalize,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6424 const char *type,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6425 OrthancPluginJobGetProgress getProgress,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6426 OrthancPluginJobGetContent getContent,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6427 OrthancPluginJobGetSerialized getSerialized,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6428 OrthancPluginJobStep step,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6429 OrthancPluginJobStop stop,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6430 OrthancPluginJobReset reset)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6431 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6432 OrthancPluginJob* target = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6433
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6434 _OrthancPluginCreateJob params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6435 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6436
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6437 params.target = &target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6438 params.job = job;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6439 params.finalize = finalize;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6440 params.type = type;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6441 params.getProgress = getProgress;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6442 params.getContent = getContent;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6443 params.getSerialized = getSerialized;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6444 params.step = step;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6445 params.stop = stop;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6446 params.reset = reset;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6447
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6448 if (context->InvokeService(context, _OrthancPluginService_CreateJob, &params) != OrthancPluginErrorCode_Success ||
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6449 target == NULL)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6450 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6451 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6452 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6453 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6454 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6455 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6456 return target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6457 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6458 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6459
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6460
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6461 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6462 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6463 OrthancPluginJob* job;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6464 } _OrthancPluginFreeJob;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6465
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6466 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6467 * @brief Free a custom job.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6468 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6469 * This function frees an image that was created with OrthancPluginCreateJob().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6470 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6471 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6472 * @param job The job.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6473 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6474 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6475 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeJob(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6476 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6477 OrthancPluginJob* job)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6478 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6479 _OrthancPluginFreeJob params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6480 params.job = job;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6481
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6482 context->InvokeService(context, _OrthancPluginService_FreeJob, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6483 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6484
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6485
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6486
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6487 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6488 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6489 char** resultId;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6490 OrthancPluginJob *job;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6491 int priority;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6492 } _OrthancPluginSubmitJob;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6493
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6494 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6495 * @brief Submit a new job to the jobs engine of Orthanc.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6496 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6497 * This function adds the given job to the pending jobs of
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6498 * Orthanc. Orthanc will take take of freeing it by invoking the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6499 * finalization callback provided to OrthancPluginCreateJob().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6500 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6501 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6502 * @param job The job, as received by OrthancPluginCreateJob().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6503 * @param priority The priority of the job.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6504 * @return ID of the newly-submitted job. This string must be freed by OrthancPluginFreeString().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6505 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6506 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6507 ORTHANC_PLUGIN_INLINE char *OrthancPluginSubmitJob(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6508 OrthancPluginContext *context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6509 OrthancPluginJob *job,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6510 int priority)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6511 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6512 char* resultId = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6513
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6514 _OrthancPluginSubmitJob params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6515 memset(&params, 0, sizeof(params));
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6516
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6517 params.resultId = &resultId;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6518 params.job = job;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6519 params.priority = priority;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6520
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6521 if (context->InvokeService(context, _OrthancPluginService_SubmitJob, &params) != OrthancPluginErrorCode_Success ||
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6522 resultId == NULL)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6523 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6524 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6525 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6526 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6527 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6528 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6529 return resultId;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6530 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6531 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6532
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6533
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6534
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6535 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6536 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6537 OrthancPluginJobsUnserializer unserializer;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6538 } _OrthancPluginJobsUnserializer;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6539
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6540 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6541 * @brief Register an unserializer for custom jobs.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6542 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6543 * This function registers an unserializer that decodes custom jobs
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6544 * from a JSON string. This callback is invoked when the jobs engine
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6545 * of Orthanc is started (on Orthanc initialization), for each job
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6546 * that is stored in the Orthanc database.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6547 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6548 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6549 * @param unserializer The job unserializer.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6550 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6551 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6552 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterJobsUnserializer(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6553 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6554 OrthancPluginJobsUnserializer unserializer)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6555 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6556 _OrthancPluginJobsUnserializer params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6557 params.unserializer = unserializer;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6558
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6559 context->InvokeService(context, _OrthancPluginService_RegisterJobsUnserializer, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6560 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6561
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6562
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6563
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6564 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6565 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6566 OrthancPluginRestOutput* output;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6567 const char* details;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6568 uint8_t log;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6569 } _OrthancPluginSetHttpErrorDetails;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6570
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6571 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6572 * @brief Provide a detailed description for an HTTP error.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6573 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6574 * This function sets the detailed description associated with an
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6575 * HTTP error. This description will be displayed in the "Details"
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6576 * field of the JSON body of the HTTP answer. It is only taken into
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6577 * consideration if the REST callback returns an error code that is
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6578 * different from "OrthancPluginErrorCode_Success", and if the
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6579 * "HttpDescribeErrors" configuration option of Orthanc is set to
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6580 * "true".
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6581 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6582 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6583 * @param output The HTTP connection to the client application.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6584 * @param details The details of the error message.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6585 * @param log Whether to also write the detailed error to the Orthanc logs.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6586 * @ingroup REST
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6587 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6588 ORTHANC_PLUGIN_INLINE void OrthancPluginSetHttpErrorDetails(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6589 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6590 OrthancPluginRestOutput* output,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6591 const char* details,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6592 uint8_t log)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6593 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6594 _OrthancPluginSetHttpErrorDetails params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6595 params.output = output;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6596 params.details = details;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6597 params.log = log;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6598 context->InvokeService(context, _OrthancPluginService_SetHttpErrorDetails, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6599 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6600
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6601
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6602
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6603 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6604 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6605 const char** result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6606 const char* argument;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6607 } _OrthancPluginRetrieveStaticString;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6608
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6609 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6610 * @brief Detect the MIME type of a file.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6611 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6612 * This function returns the MIME type of a file by inspecting its extension.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6613 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6614 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6615 * @param path Path to the file.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6616 * @return The MIME type. This is a statically-allocated
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6617 * string, do not free it.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6618 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6619 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6620 ORTHANC_PLUGIN_INLINE const char* OrthancPluginAutodetectMimeType(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6621 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6622 const char* path)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6623 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6624 const char* result = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6625
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6626 _OrthancPluginRetrieveStaticString params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6627 params.result = &result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6628 params.argument = path;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6629
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6630 if (context->InvokeService(context, _OrthancPluginService_AutodetectMimeType, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6631 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6632 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6633 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6634 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6635 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6636 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6637 return result;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6638 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6639 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6640
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6641
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6642
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6643 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6644 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6645 const char* name;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6646 float value;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6647 OrthancPluginMetricsType type;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6648 } _OrthancPluginSetMetricsValue;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6649
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6650 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6651 * @brief Set the value of a metrics.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6652 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6653 * This function sets the value of a metrics to monitor the behavior
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6654 * of the plugin through tools such as Prometheus. The values of all
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6655 * the metrics are stored within the Orthanc context.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6656 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6657 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6658 * @param name The name of the metrics to be set.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6659 * @param value The value of the metrics.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6660 * @param type The type of the metrics. This parameter is only taken into consideration
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6661 * the first time this metrics is set.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6662 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6663 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6664 ORTHANC_PLUGIN_INLINE void OrthancPluginSetMetricsValue(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6665 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6666 const char* name,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6667 float value,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6668 OrthancPluginMetricsType type)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6669 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6670 _OrthancPluginSetMetricsValue params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6671 params.name = name;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6672 params.value = value;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6673 params.type = type;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6674 context->InvokeService(context, _OrthancPluginService_SetMetricsValue, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6675 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6676
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6677
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6678
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6679 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6680 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6681 OrthancPluginRefreshMetricsCallback callback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6682 } _OrthancPluginRegisterRefreshMetricsCallback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6683
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6684 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6685 * @brief Register a callback to refresh the metrics.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6686 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6687 * This function registers a callback to refresh the metrics. The
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6688 * callback must make calls to OrthancPluginSetMetricsValue().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6689 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6690 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6691 * @param callback The callback function to handle the refresh.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6692 * @ingroup Callbacks
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6693 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6694 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRefreshMetricsCallback(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6695 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6696 OrthancPluginRefreshMetricsCallback callback)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6697 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6698 _OrthancPluginRegisterRefreshMetricsCallback params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6699 params.callback = callback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6700 context->InvokeService(context, _OrthancPluginService_RegisterRefreshMetricsCallback, &params);
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6701 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6702
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6703
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6704
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6705
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6706 typedef struct
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6707 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6708 char** target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6709 const void* dicom;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6710 uint32_t dicomSize;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6711 OrthancPluginDicomWebBinaryCallback callback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6712 } _OrthancPluginEncodeDicomWeb;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6713
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6714 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6715 * @brief Convert a DICOM instance to DICOMweb JSON.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6716 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6717 * This function converts a memory buffer containing a DICOM instance,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6718 * into its DICOMweb JSON representation.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6719 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6720 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6721 * @param dicom Pointer to the DICOM instance.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6722 * @param dicomSize Size of the DICOM instance.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6723 * @param callback Callback to set the value of the binary tags.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6724 * @see OrthancPluginCreateDicom()
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6725 * @return The NULL value in case of error, or the JSON document. This string must
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6726 * be freed by OrthancPluginFreeString().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6727 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6728 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6729 ORTHANC_PLUGIN_INLINE char* OrthancPluginEncodeDicomWebJson(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6730 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6731 const void* dicom,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6732 uint32_t dicomSize,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6733 OrthancPluginDicomWebBinaryCallback callback)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6734 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6735 char* target = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6736
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6737 _OrthancPluginEncodeDicomWeb params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6738 params.target = &target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6739 params.dicom = dicom;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6740 params.dicomSize = dicomSize;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6741 params.callback = callback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6742
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6743 if (context->InvokeService(context, _OrthancPluginService_EncodeDicomWebJson, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6744 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6745 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6746 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6747 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6748 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6749 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6750 return target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6751 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6752 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6753
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6754
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6755 /**
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6756 * @brief Convert a DICOM instance to DICOMweb XML.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6757 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6758 * This function converts a memory buffer containing a DICOM instance,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6759 * into its DICOMweb XML representation.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6760 *
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6761 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6762 * @param dicom Pointer to the DICOM instance.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6763 * @param dicomSize Size of the DICOM instance.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6764 * @param callback Callback to set the value of the binary tags.
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6765 * @return The NULL value in case of error, or the JSON document. This string must
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6766 * be freed by OrthancPluginFreeString().
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6767 * @see OrthancPluginCreateDicom()
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6768 * @ingroup Toolbox
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6769 **/
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6770 ORTHANC_PLUGIN_INLINE char* OrthancPluginEncodeDicomWebXml(
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6771 OrthancPluginContext* context,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6772 const void* dicom,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6773 uint32_t dicomSize,
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6774 OrthancPluginDicomWebBinaryCallback callback)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6775 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6776 char* target = NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6777
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6778 _OrthancPluginEncodeDicomWeb params;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6779 params.target = &target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6780 params.dicom = dicom;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6781 params.dicomSize = dicomSize;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6782 params.callback = callback;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6783
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6784 if (context->InvokeService(context, _OrthancPluginService_EncodeDicomWebXml, &params) != OrthancPluginErrorCode_Success)
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6785 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6786 /* Error */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6787 return NULL;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6788 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6789 else
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6790 {
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6791 return target;
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6792 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6793 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6794
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6795
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6796 #ifdef __cplusplus
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6797 }
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6798 #endif
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6799
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6800
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6801 /** @} */
121ab36c87bd updating to Orthanc SDK 1.5.4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6802