annotate Resources/Orthanc/Sdk-1.5.2/orthanc/OrthancCPlugin.h @ 170:e712ff3eede3

sync
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 06 Nov 2020 17:51:01 +0100
parents d0b02fd48a92
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
94
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * \mainpage
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * This C/C++ SDK allows external developers to create plugins that
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 * can be loaded into Orthanc to extend its functionality. Each
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 * Orthanc plugin must expose 4 public functions with the following
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * signatures:
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * -# <tt>int32_t OrthancPluginInitialize(const OrthancPluginContext* context)</tt>:
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * This function is invoked by Orthanc when it loads the plugin on startup.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * The plugin must:
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * - Check its compatibility with the Orthanc version using
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * ::OrthancPluginCheckVersion().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * - Store the context pointer so that it can use the plugin
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * services of Orthanc.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * - Register all its REST callbacks using ::OrthancPluginRegisterRestCallback().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * - Possibly register its callback for received DICOM instances using ::OrthancPluginRegisterOnStoredInstanceCallback().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * - Possibly register its callback for changes to the DICOM store using ::OrthancPluginRegisterOnChangeCallback().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * - Possibly register a custom storage area using ::OrthancPluginRegisterStorageArea().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * - Possibly register a custom database back-end area using OrthancPluginRegisterDatabaseBackendV2().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 * - Possibly register a handler for C-Find SCP using OrthancPluginRegisterFindCallback().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 * - Possibly register a handler for C-Find SCP against DICOM worklists using OrthancPluginRegisterWorklistCallback().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 * - Possibly register a handler for C-Move SCP using OrthancPluginRegisterMoveCallback().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 * - Possibly register a custom decoder for DICOM images using OrthancPluginRegisterDecodeImageCallback().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 * - Possibly register a callback to filter incoming HTTP requests using OrthancPluginRegisterIncomingHttpRequestFilter2().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 * - Possibly register a callback to unserialize jobs using OrthancPluginRegisterJobsUnserializer().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 * -# <tt>void OrthancPluginFinalize()</tt>:
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 * This function is invoked by Orthanc during its shutdown. The plugin
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 * must free all its memory.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 * -# <tt>const char* OrthancPluginGetName()</tt>:
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 * The plugin must return a short string to identify itself.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 * -# <tt>const char* OrthancPluginGetVersion()</tt>:
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 * The plugin must return a string containing its version number.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 * The name and the version of a plugin is only used to prevent it
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 * from being loaded twice. Note that, in C++, it is mandatory to
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 * declare these functions within an <tt>extern "C"</tt> section.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 * To ensure multi-threading safety, the various REST callbacks are
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 * guaranteed to be executed in mutual exclusion since Orthanc
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 * 0.8.5. If this feature is undesired (notably when developing
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 * high-performance plugins handling simultaneous requests), use
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 * ::OrthancPluginRegisterRestCallbackNoLock().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 * @defgroup Images Images and compression
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 * @brief Functions to deal with images and compressed buffers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 * @defgroup REST REST
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 * @brief Functions to answer REST requests in a callback.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 * @defgroup Callbacks Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 * @brief Functions to register and manage callbacks by the plugins.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 * @defgroup DicomCallbacks DicomCallbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 * @brief Functions to register and manage DICOM callbacks (worklists, C-Find, C-MOVE).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 * @defgroup Orthanc Orthanc
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 * @brief Functions to access the content of the Orthanc server.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 * @defgroup Toolbox Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 * @brief Generic functions to help with the creation of plugins.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 * Orthanc - A Lightweight, RESTful DICOM Store
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 * Department, University Hospital of Liege, Belgium
149
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 140
diff changeset
78 * Copyright (C) 2017-2019 Osimis S.A., Belgium
94
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 * This program is free software: you can redistribute it and/or
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 * modify it under the terms of the GNU General Public License as
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 * published by the Free Software Foundation, either version 3 of the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 * License, or (at your option) any later version.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 * In addition, as a special exception, the copyright holders of this
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 * program give permission to link the code of its release with the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 * OpenSSL project's "OpenSSL" library (or with modified versions of it
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 * that use the same license as the "OpenSSL" library), and distribute
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 * the linked executables. You must obey the GNU General Public License
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 * in all respects for all of the code used other than "OpenSSL". If you
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 * modify file(s) with this exception, you may extend this exception to
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 * your version of the file(s), but you are not obligated to do so. If
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 * you do not wish to do so, delete this exception statement from your
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 * version. If you delete this exception statement from all source files
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 * in the program, then also delete it here.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 * This program is distributed in the hope that it will be useful, but
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 * WITHOUT ANY WARRANTY; without even the implied warranty of
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 * General Public License for more details.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 * You should have received a copy of the GNU General Public License
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 * along with this program. If not, see <http://www.gnu.org/licenses/>.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 #pragma once
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 #include <stdio.h>
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 #include <string.h>
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 #ifdef WIN32
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 #define ORTHANC_PLUGINS_API __declspec(dllexport)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 #else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 #define ORTHANC_PLUGINS_API
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 #endif
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120 #define ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER 1
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 #define ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER 5
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 #define ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER 2
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 #if !defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 #define ORTHANC_PLUGINS_VERSION_IS_ABOVE(major, minor, revision) \
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER > major || \
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER == major && \
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 (ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER > minor || \
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 (ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER == minor && \
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER >= revision))))
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 #endif
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 /********************************************************************
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 ** Check that function inlining is properly supported. The use of
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 ** inlining is required, to avoid the duplication of object code
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 ** between two compilation modules that would use the Orthanc Plugin
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 ** API.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 ********************************************************************/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 /* If the auto-detection of the "inline" keyword below does not work
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 automatically and that your compiler is known to properly support
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 inlining, uncomment the following #define and adapt the definition
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 of "static inline". */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 /* #define ORTHANC_PLUGIN_INLINE static inline */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 #ifndef ORTHANC_PLUGIN_INLINE
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 # if __STDC_VERSION__ >= 199901L
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 /* This is C99 or above: http://predef.sourceforge.net/prestd.html */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 # define ORTHANC_PLUGIN_INLINE static inline
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154 # elif defined(__cplusplus)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 /* This is C++ */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 # define ORTHANC_PLUGIN_INLINE static inline
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 # elif defined(__GNUC__)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 /* This is GCC running in C89 mode */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 # define ORTHANC_PLUGIN_INLINE static __inline
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 # elif defined(_MSC_VER)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 /* This is Visual Studio running in C89 mode */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 # define ORTHANC_PLUGIN_INLINE static __inline
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 # else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 # error Your compiler is not known to support the "inline" keyword
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 # endif
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166 #endif
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170 /********************************************************************
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171 ** Inclusion of standard libraries.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172 ********************************************************************/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
173
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175 * For Microsoft Visual Studio, a compatibility "stdint.h" can be
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
176 * downloaded at the following URL:
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177 * https://orthanc.googlecode.com/hg/Resources/ThirdParty/VisualStudio/stdint.h
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
178 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
179 #include <stdint.h>
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
180
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181 #include <stdlib.h>
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
183
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
184
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
185 /********************************************************************
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
186 ** Definition of the Orthanc Plugin API.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187 ********************************************************************/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
188
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
189 /** @{ */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
190
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
191 #ifdef __cplusplus
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
192 extern "C"
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
193 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
194 #endif
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
196 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197 * The various error codes that can be returned by the Orthanc core.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
198 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
199 typedef enum
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
201 OrthancPluginErrorCode_InternalError = -1 /*!< Internal error */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
202 OrthancPluginErrorCode_Success = 0 /*!< Success */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
203 OrthancPluginErrorCode_Plugin = 1 /*!< Error encountered within the plugin engine */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
204 OrthancPluginErrorCode_NotImplemented = 2 /*!< Not implemented yet */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
205 OrthancPluginErrorCode_ParameterOutOfRange = 3 /*!< Parameter out of range */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
206 OrthancPluginErrorCode_NotEnoughMemory = 4 /*!< The server hosting Orthanc is running out of memory */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
207 OrthancPluginErrorCode_BadParameterType = 5 /*!< Bad type for a parameter */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
208 OrthancPluginErrorCode_BadSequenceOfCalls = 6 /*!< Bad sequence of calls */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
209 OrthancPluginErrorCode_InexistentItem = 7 /*!< Accessing an inexistent item */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
210 OrthancPluginErrorCode_BadRequest = 8 /*!< Bad request */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
211 OrthancPluginErrorCode_NetworkProtocol = 9 /*!< Error in the network protocol */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
212 OrthancPluginErrorCode_SystemCommand = 10 /*!< Error while calling a system command */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
213 OrthancPluginErrorCode_Database = 11 /*!< Error with the database engine */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
214 OrthancPluginErrorCode_UriSyntax = 12 /*!< Badly formatted URI */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
215 OrthancPluginErrorCode_InexistentFile = 13 /*!< Inexistent file */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
216 OrthancPluginErrorCode_CannotWriteFile = 14 /*!< Cannot write to file */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
217 OrthancPluginErrorCode_BadFileFormat = 15 /*!< Bad file format */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
218 OrthancPluginErrorCode_Timeout = 16 /*!< Timeout */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
219 OrthancPluginErrorCode_UnknownResource = 17 /*!< Unknown resource */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
220 OrthancPluginErrorCode_IncompatibleDatabaseVersion = 18 /*!< Incompatible version of the database */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
221 OrthancPluginErrorCode_FullStorage = 19 /*!< The file storage is full */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
222 OrthancPluginErrorCode_CorruptedFile = 20 /*!< Corrupted file (e.g. inconsistent MD5 hash) */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
223 OrthancPluginErrorCode_InexistentTag = 21 /*!< Inexistent tag */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
224 OrthancPluginErrorCode_ReadOnly = 22 /*!< Cannot modify a read-only data structure */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
225 OrthancPluginErrorCode_IncompatibleImageFormat = 23 /*!< Incompatible format of the images */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
226 OrthancPluginErrorCode_IncompatibleImageSize = 24 /*!< Incompatible size of the images */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
227 OrthancPluginErrorCode_SharedLibrary = 25 /*!< Error while using a shared library (plugin) */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
228 OrthancPluginErrorCode_UnknownPluginService = 26 /*!< Plugin invoking an unknown service */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
229 OrthancPluginErrorCode_UnknownDicomTag = 27 /*!< Unknown DICOM tag */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
230 OrthancPluginErrorCode_BadJson = 28 /*!< Cannot parse a JSON document */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
231 OrthancPluginErrorCode_Unauthorized = 29 /*!< Bad credentials were provided to an HTTP request */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
232 OrthancPluginErrorCode_BadFont = 30 /*!< Badly formatted font file */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
233 OrthancPluginErrorCode_DatabasePlugin = 31 /*!< The plugin implementing a custom database back-end does not fulfill the proper interface */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
234 OrthancPluginErrorCode_StorageAreaPlugin = 32 /*!< Error in the plugin implementing a custom storage area */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
235 OrthancPluginErrorCode_EmptyRequest = 33 /*!< The request is empty */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
236 OrthancPluginErrorCode_NotAcceptable = 34 /*!< Cannot send a response which is acceptable according to the Accept HTTP header */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
237 OrthancPluginErrorCode_NullPointer = 35 /*!< Cannot handle a NULL pointer */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
238 OrthancPluginErrorCode_DatabaseUnavailable = 36 /*!< The database is currently not available (probably a transient situation) */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
239 OrthancPluginErrorCode_CanceledJob = 37 /*!< This job was canceled */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
240 OrthancPluginErrorCode_SQLiteNotOpened = 1000 /*!< SQLite: The database is not opened */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
241 OrthancPluginErrorCode_SQLiteAlreadyOpened = 1001 /*!< SQLite: Connection is already open */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
242 OrthancPluginErrorCode_SQLiteCannotOpen = 1002 /*!< SQLite: Unable to open the database */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
243 OrthancPluginErrorCode_SQLiteStatementAlreadyUsed = 1003 /*!< SQLite: This cached statement is already being referred to */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
244 OrthancPluginErrorCode_SQLiteExecute = 1004 /*!< SQLite: Cannot execute a command */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
245 OrthancPluginErrorCode_SQLiteRollbackWithoutTransaction = 1005 /*!< SQLite: Rolling back a nonexistent transaction (have you called Begin()?) */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
246 OrthancPluginErrorCode_SQLiteCommitWithoutTransaction = 1006 /*!< SQLite: Committing a nonexistent transaction */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
247 OrthancPluginErrorCode_SQLiteRegisterFunction = 1007 /*!< SQLite: Unable to register a function */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
248 OrthancPluginErrorCode_SQLiteFlush = 1008 /*!< SQLite: Unable to flush the database */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
249 OrthancPluginErrorCode_SQLiteCannotRun = 1009 /*!< SQLite: Cannot run a cached statement */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
250 OrthancPluginErrorCode_SQLiteCannotStep = 1010 /*!< SQLite: Cannot step over a cached statement */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
251 OrthancPluginErrorCode_SQLiteBindOutOfRange = 1011 /*!< SQLite: Bing a value while out of range (serious error) */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
252 OrthancPluginErrorCode_SQLitePrepareStatement = 1012 /*!< SQLite: Cannot prepare a cached statement */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
253 OrthancPluginErrorCode_SQLiteTransactionAlreadyStarted = 1013 /*!< SQLite: Beginning the same transaction twice */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
254 OrthancPluginErrorCode_SQLiteTransactionCommit = 1014 /*!< SQLite: Failure when committing the transaction */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
255 OrthancPluginErrorCode_SQLiteTransactionBegin = 1015 /*!< SQLite: Cannot start a transaction */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
256 OrthancPluginErrorCode_DirectoryOverFile = 2000 /*!< The directory to be created is already occupied by a regular file */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
257 OrthancPluginErrorCode_FileStorageCannotWrite = 2001 /*!< Unable to create a subdirectory or a file in the file storage */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
258 OrthancPluginErrorCode_DirectoryExpected = 2002 /*!< The specified path does not point to a directory */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
259 OrthancPluginErrorCode_HttpPortInUse = 2003 /*!< The TCP port of the HTTP server is privileged or already in use */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
260 OrthancPluginErrorCode_DicomPortInUse = 2004 /*!< The TCP port of the DICOM server is privileged or already in use */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
261 OrthancPluginErrorCode_BadHttpStatusInRest = 2005 /*!< This HTTP status is not allowed in a REST API */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
262 OrthancPluginErrorCode_RegularFileExpected = 2006 /*!< The specified path does not point to a regular file */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
263 OrthancPluginErrorCode_PathToExecutable = 2007 /*!< Unable to get the path to the executable */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
264 OrthancPluginErrorCode_MakeDirectory = 2008 /*!< Cannot create a directory */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
265 OrthancPluginErrorCode_BadApplicationEntityTitle = 2009 /*!< An application entity title (AET) cannot be empty or be longer than 16 characters */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
266 OrthancPluginErrorCode_NoCFindHandler = 2010 /*!< No request handler factory for DICOM C-FIND SCP */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
267 OrthancPluginErrorCode_NoCMoveHandler = 2011 /*!< No request handler factory for DICOM C-MOVE SCP */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
268 OrthancPluginErrorCode_NoCStoreHandler = 2012 /*!< No request handler factory for DICOM C-STORE SCP */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
269 OrthancPluginErrorCode_NoApplicationEntityFilter = 2013 /*!< No application entity filter */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
270 OrthancPluginErrorCode_NoSopClassOrInstance = 2014 /*!< DicomUserConnection: Unable to find the SOP class and instance */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
271 OrthancPluginErrorCode_NoPresentationContext = 2015 /*!< DicomUserConnection: No acceptable presentation context for modality */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
272 OrthancPluginErrorCode_DicomFindUnavailable = 2016 /*!< DicomUserConnection: The C-FIND command is not supported by the remote SCP */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
273 OrthancPluginErrorCode_DicomMoveUnavailable = 2017 /*!< DicomUserConnection: The C-MOVE command is not supported by the remote SCP */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
274 OrthancPluginErrorCode_CannotStoreInstance = 2018 /*!< Cannot store an instance */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
275 OrthancPluginErrorCode_CreateDicomNotString = 2019 /*!< Only string values are supported when creating DICOM instances */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
276 OrthancPluginErrorCode_CreateDicomOverrideTag = 2020 /*!< Trying to override a value inherited from a parent module */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
277 OrthancPluginErrorCode_CreateDicomUseContent = 2021 /*!< Use \"Content\" to inject an image into a new DICOM instance */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
278 OrthancPluginErrorCode_CreateDicomNoPayload = 2022 /*!< No payload is present for one instance in the series */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
279 OrthancPluginErrorCode_CreateDicomUseDataUriScheme = 2023 /*!< The payload of the DICOM instance must be specified according to Data URI scheme */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
280 OrthancPluginErrorCode_CreateDicomBadParent = 2024 /*!< Trying to attach a new DICOM instance to an inexistent resource */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
281 OrthancPluginErrorCode_CreateDicomParentIsInstance = 2025 /*!< Trying to attach a new DICOM instance to an instance (must be a series, study or patient) */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
282 OrthancPluginErrorCode_CreateDicomParentEncoding = 2026 /*!< Unable to get the encoding of the parent resource */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
283 OrthancPluginErrorCode_UnknownModality = 2027 /*!< Unknown modality */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
284 OrthancPluginErrorCode_BadJobOrdering = 2028 /*!< Bad ordering of filters in a job */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
285 OrthancPluginErrorCode_JsonToLuaTable = 2029 /*!< Cannot convert the given JSON object to a Lua table */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
286 OrthancPluginErrorCode_CannotCreateLua = 2030 /*!< Cannot create the Lua context */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
287 OrthancPluginErrorCode_CannotExecuteLua = 2031 /*!< Cannot execute a Lua command */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
288 OrthancPluginErrorCode_LuaAlreadyExecuted = 2032 /*!< Arguments cannot be pushed after the Lua function is executed */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
289 OrthancPluginErrorCode_LuaBadOutput = 2033 /*!< The Lua function does not give the expected number of outputs */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
290 OrthancPluginErrorCode_NotLuaPredicate = 2034 /*!< The Lua function is not a predicate (only true/false outputs allowed) */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
291 OrthancPluginErrorCode_LuaReturnsNoString = 2035 /*!< The Lua function does not return a string */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
292 OrthancPluginErrorCode_StorageAreaAlreadyRegistered = 2036 /*!< Another plugin has already registered a custom storage area */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
293 OrthancPluginErrorCode_DatabaseBackendAlreadyRegistered = 2037 /*!< Another plugin has already registered a custom database back-end */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
294 OrthancPluginErrorCode_DatabaseNotInitialized = 2038 /*!< Plugin trying to call the database during its initialization */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
295 OrthancPluginErrorCode_SslDisabled = 2039 /*!< Orthanc has been built without SSL support */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
296 OrthancPluginErrorCode_CannotOrderSlices = 2040 /*!< Unable to order the slices of the series */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
297 OrthancPluginErrorCode_NoWorklistHandler = 2041 /*!< No request handler factory for DICOM C-Find Modality SCP */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
298 OrthancPluginErrorCode_AlreadyExistingTag = 2042 /*!< Cannot override the value of a tag that already exists */,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
299
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
300 _OrthancPluginErrorCode_INTERNAL = 0x7fffffff
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
301 } OrthancPluginErrorCode;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
302
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
303
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
304 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
305 * Forward declaration of one of the mandatory functions for Orthanc
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
306 * plugins.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
307 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
308 ORTHANC_PLUGINS_API const char* OrthancPluginGetName();
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
309
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
310
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
311 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
312 * The various HTTP methods for a REST call.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
313 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
314 typedef enum
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
315 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
316 OrthancPluginHttpMethod_Get = 1, /*!< GET request */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
317 OrthancPluginHttpMethod_Post = 2, /*!< POST request */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
318 OrthancPluginHttpMethod_Put = 3, /*!< PUT request */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
319 OrthancPluginHttpMethod_Delete = 4, /*!< DELETE request */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
320
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
321 _OrthancPluginHttpMethod_INTERNAL = 0x7fffffff
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
322 } OrthancPluginHttpMethod;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
323
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
324
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
325 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
326 * @brief The parameters of a REST request.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
327 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
328 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
329 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
330 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
331 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
332 * @brief The HTTP method.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
333 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
334 OrthancPluginHttpMethod method;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
335
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
336 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
337 * @brief The number of groups of the regular expression.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
338 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
339 uint32_t groupsCount;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
340
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
341 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
342 * @brief The matched values for the groups of the regular expression.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
343 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
344 const char* const* groups;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
345
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
346 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
347 * @brief For a GET request, the number of GET parameters.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
348 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
349 uint32_t getCount;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
350
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
351 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
352 * @brief For a GET request, the keys of the GET parameters.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
353 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
354 const char* const* getKeys;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
355
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
356 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
357 * @brief For a GET request, the values of the GET parameters.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
358 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
359 const char* const* getValues;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
360
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
361 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
362 * @brief For a PUT or POST request, the content of the body.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
363 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
364 const char* body;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
365
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
366 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
367 * @brief For a PUT or POST request, the number of bytes of the body.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
368 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
369 uint32_t bodySize;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
370
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
371
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
372 /* --------------------------------------------------
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
373 New in version 0.8.1
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
374 -------------------------------------------------- */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
375
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
376 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
377 * @brief The number of HTTP headers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
378 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
379 uint32_t headersCount;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
380
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
381 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
382 * @brief The keys of the HTTP headers (always converted to low-case).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
383 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
384 const char* const* headersKeys;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
385
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
386 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
387 * @brief The values of the HTTP headers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
388 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
389 const char* const* headersValues;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
390
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
391 } OrthancPluginHttpRequest;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
392
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
393
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
394 typedef enum
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
395 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
396 /* Generic services */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
397 _OrthancPluginService_LogInfo = 1,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
398 _OrthancPluginService_LogWarning = 2,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
399 _OrthancPluginService_LogError = 3,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
400 _OrthancPluginService_GetOrthancPath = 4,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
401 _OrthancPluginService_GetOrthancDirectory = 5,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
402 _OrthancPluginService_GetConfigurationPath = 6,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
403 _OrthancPluginService_SetPluginProperty = 7,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
404 _OrthancPluginService_GetGlobalProperty = 8,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
405 _OrthancPluginService_SetGlobalProperty = 9,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
406 _OrthancPluginService_GetCommandLineArgumentsCount = 10,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
407 _OrthancPluginService_GetCommandLineArgument = 11,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
408 _OrthancPluginService_GetExpectedDatabaseVersion = 12,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
409 _OrthancPluginService_GetConfiguration = 13,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
410 _OrthancPluginService_BufferCompression = 14,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
411 _OrthancPluginService_ReadFile = 15,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
412 _OrthancPluginService_WriteFile = 16,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
413 _OrthancPluginService_GetErrorDescription = 17,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
414 _OrthancPluginService_CallHttpClient = 18,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
415 _OrthancPluginService_RegisterErrorCode = 19,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
416 _OrthancPluginService_RegisterDictionaryTag = 20,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
417 _OrthancPluginService_DicomBufferToJson = 21,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
418 _OrthancPluginService_DicomInstanceToJson = 22,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
419 _OrthancPluginService_CreateDicom = 23,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
420 _OrthancPluginService_ComputeMd5 = 24,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
421 _OrthancPluginService_ComputeSha1 = 25,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
422 _OrthancPluginService_LookupDictionary = 26,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
423 _OrthancPluginService_CallHttpClient2 = 27,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
424 _OrthancPluginService_GenerateUuid = 28,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
425 _OrthancPluginService_RegisterPrivateDictionaryTag = 29,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
426 _OrthancPluginService_AutodetectMimeType = 30,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
427
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
428 /* Registration of callbacks */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
429 _OrthancPluginService_RegisterRestCallback = 1000,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
430 _OrthancPluginService_RegisterOnStoredInstanceCallback = 1001,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
431 _OrthancPluginService_RegisterStorageArea = 1002,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
432 _OrthancPluginService_RegisterOnChangeCallback = 1003,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
433 _OrthancPluginService_RegisterRestCallbackNoLock = 1004,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
434 _OrthancPluginService_RegisterWorklistCallback = 1005,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
435 _OrthancPluginService_RegisterDecodeImageCallback = 1006,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
436 _OrthancPluginService_RegisterIncomingHttpRequestFilter = 1007,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
437 _OrthancPluginService_RegisterFindCallback = 1008,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
438 _OrthancPluginService_RegisterMoveCallback = 1009,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
439 _OrthancPluginService_RegisterIncomingHttpRequestFilter2 = 1010,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
440
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
441 /* Sending answers to REST calls */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
442 _OrthancPluginService_AnswerBuffer = 2000,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
443 _OrthancPluginService_CompressAndAnswerPngImage = 2001, /* Unused as of Orthanc 0.9.4 */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
444 _OrthancPluginService_Redirect = 2002,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
445 _OrthancPluginService_SendHttpStatusCode = 2003,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
446 _OrthancPluginService_SendUnauthorized = 2004,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
447 _OrthancPluginService_SendMethodNotAllowed = 2005,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
448 _OrthancPluginService_SetCookie = 2006,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
449 _OrthancPluginService_SetHttpHeader = 2007,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
450 _OrthancPluginService_StartMultipartAnswer = 2008,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
451 _OrthancPluginService_SendMultipartItem = 2009,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
452 _OrthancPluginService_SendHttpStatus = 2010,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
453 _OrthancPluginService_CompressAndAnswerImage = 2011,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
454 _OrthancPluginService_SendMultipartItem2 = 2012,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
455 _OrthancPluginService_SetHttpErrorDetails = 2013,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
456
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
457 /* Access to the Orthanc database and API */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
458 _OrthancPluginService_GetDicomForInstance = 3000,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
459 _OrthancPluginService_RestApiGet = 3001,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
460 _OrthancPluginService_RestApiPost = 3002,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
461 _OrthancPluginService_RestApiDelete = 3003,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
462 _OrthancPluginService_RestApiPut = 3004,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
463 _OrthancPluginService_LookupPatient = 3005,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
464 _OrthancPluginService_LookupStudy = 3006,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
465 _OrthancPluginService_LookupSeries = 3007,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
466 _OrthancPluginService_LookupInstance = 3008,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
467 _OrthancPluginService_LookupStudyWithAccessionNumber = 3009,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
468 _OrthancPluginService_RestApiGetAfterPlugins = 3010,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
469 _OrthancPluginService_RestApiPostAfterPlugins = 3011,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
470 _OrthancPluginService_RestApiDeleteAfterPlugins = 3012,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
471 _OrthancPluginService_RestApiPutAfterPlugins = 3013,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
472 _OrthancPluginService_ReconstructMainDicomTags = 3014,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
473 _OrthancPluginService_RestApiGet2 = 3015,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
474
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
475 /* Access to DICOM instances */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
476 _OrthancPluginService_GetInstanceRemoteAet = 4000,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
477 _OrthancPluginService_GetInstanceSize = 4001,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
478 _OrthancPluginService_GetInstanceData = 4002,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
479 _OrthancPluginService_GetInstanceJson = 4003,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
480 _OrthancPluginService_GetInstanceSimplifiedJson = 4004,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
481 _OrthancPluginService_HasInstanceMetadata = 4005,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
482 _OrthancPluginService_GetInstanceMetadata = 4006,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
483 _OrthancPluginService_GetInstanceOrigin = 4007,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
484
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
485 /* Services for plugins implementing a database back-end */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
486 _OrthancPluginService_RegisterDatabaseBackend = 5000,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
487 _OrthancPluginService_DatabaseAnswer = 5001,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
488 _OrthancPluginService_RegisterDatabaseBackendV2 = 5002,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
489 _OrthancPluginService_StorageAreaCreate = 5003,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
490 _OrthancPluginService_StorageAreaRead = 5004,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
491 _OrthancPluginService_StorageAreaRemove = 5005,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
492
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
493 /* Primitives for handling images */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
494 _OrthancPluginService_GetImagePixelFormat = 6000,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
495 _OrthancPluginService_GetImageWidth = 6001,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
496 _OrthancPluginService_GetImageHeight = 6002,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
497 _OrthancPluginService_GetImagePitch = 6003,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
498 _OrthancPluginService_GetImageBuffer = 6004,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
499 _OrthancPluginService_UncompressImage = 6005,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
500 _OrthancPluginService_FreeImage = 6006,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
501 _OrthancPluginService_CompressImage = 6007,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
502 _OrthancPluginService_ConvertPixelFormat = 6008,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
503 _OrthancPluginService_GetFontsCount = 6009,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
504 _OrthancPluginService_GetFontInfo = 6010,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
505 _OrthancPluginService_DrawText = 6011,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
506 _OrthancPluginService_CreateImage = 6012,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
507 _OrthancPluginService_CreateImageAccessor = 6013,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
508 _OrthancPluginService_DecodeDicomImage = 6014,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
509
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
510 /* Primitives for handling C-Find, C-Move and worklists */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
511 _OrthancPluginService_WorklistAddAnswer = 7000,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
512 _OrthancPluginService_WorklistMarkIncomplete = 7001,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
513 _OrthancPluginService_WorklistIsMatch = 7002,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
514 _OrthancPluginService_WorklistGetDicomQuery = 7003,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
515 _OrthancPluginService_FindAddAnswer = 7004,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
516 _OrthancPluginService_FindMarkIncomplete = 7005,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
517 _OrthancPluginService_GetFindQuerySize = 7006,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
518 _OrthancPluginService_GetFindQueryTag = 7007,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
519 _OrthancPluginService_GetFindQueryTagName = 7008,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
520 _OrthancPluginService_GetFindQueryValue = 7009,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
521 _OrthancPluginService_CreateFindMatcher = 7010,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
522 _OrthancPluginService_FreeFindMatcher = 7011,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
523 _OrthancPluginService_FindMatcherIsMatch = 7012,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
524
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
525 /* Primitives for accessing Orthanc Peers (new in 1.4.2) */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
526 _OrthancPluginService_GetPeers = 8000,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
527 _OrthancPluginService_FreePeers = 8001,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
528 _OrthancPluginService_GetPeersCount = 8003,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
529 _OrthancPluginService_GetPeerName = 8004,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
530 _OrthancPluginService_GetPeerUrl = 8005,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
531 _OrthancPluginService_CallPeerApi = 8006,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
532 _OrthancPluginService_GetPeerUserProperty = 8007,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
533
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
534 /* Primitives for handling jobs (new in 1.4.2) */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
535 _OrthancPluginService_CreateJob = 9000,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
536 _OrthancPluginService_FreeJob = 9001,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
537 _OrthancPluginService_SubmitJob = 9002,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
538 _OrthancPluginService_RegisterJobsUnserializer = 9003,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
539
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
540 _OrthancPluginService_INTERNAL = 0x7fffffff
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
541 } _OrthancPluginService;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
542
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
543
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
544 typedef enum
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
545 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
546 _OrthancPluginProperty_Description = 1,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
547 _OrthancPluginProperty_RootUri = 2,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
548 _OrthancPluginProperty_OrthancExplorer = 3,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
549
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
550 _OrthancPluginProperty_INTERNAL = 0x7fffffff
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
551 } _OrthancPluginProperty;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
552
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
553
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
554
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
555 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
556 * The memory layout of the pixels of an image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
557 * @ingroup Images
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
558 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
559 typedef enum
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
560 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
561 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
562 * @brief Graylevel 8bpp image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
563 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
564 * The image is graylevel. Each pixel is unsigned and stored in
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
565 * one byte.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
566 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
567 OrthancPluginPixelFormat_Grayscale8 = 1,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
568
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
569 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
570 * @brief Graylevel, unsigned 16bpp image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
571 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
572 * The image is graylevel. Each pixel is unsigned and stored in
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
573 * two bytes.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
574 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
575 OrthancPluginPixelFormat_Grayscale16 = 2,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
576
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
577 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
578 * @brief Graylevel, signed 16bpp image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
579 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
580 * The image is graylevel. Each pixel is signed and stored in two
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
581 * bytes.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
582 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
583 OrthancPluginPixelFormat_SignedGrayscale16 = 3,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
584
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
585 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
586 * @brief Color image in RGB24 format.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
587 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
588 * This format describes a color image. The pixels are stored in 3
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
589 * consecutive bytes. The memory layout is RGB.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
590 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
591 OrthancPluginPixelFormat_RGB24 = 4,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
592
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
593 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
594 * @brief Color image in RGBA32 format.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
595 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
596 * This format describes a color image. The pixels are stored in 4
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
597 * consecutive bytes. The memory layout is RGBA.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
598 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
599 OrthancPluginPixelFormat_RGBA32 = 5,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
600
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
601 OrthancPluginPixelFormat_Unknown = 6, /*!< Unknown pixel format */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
602
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
603 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
604 * @brief Color image in RGB48 format.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
605 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
606 * This format describes a color image. The pixels are stored in 6
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
607 * consecutive bytes. The memory layout is RRGGBB.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
608 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
609 OrthancPluginPixelFormat_RGB48 = 7,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
610
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
611 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
612 * @brief Graylevel, unsigned 32bpp image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
613 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
614 * The image is graylevel. Each pixel is unsigned and stored in
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
615 * four bytes.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
616 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
617 OrthancPluginPixelFormat_Grayscale32 = 8,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
618
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
619 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
620 * @brief Graylevel, floating-point 32bpp image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
621 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
622 * The image is graylevel. Each pixel is floating-point and stored
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
623 * in four bytes.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
624 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
625 OrthancPluginPixelFormat_Float32 = 9,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
626
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
627 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
628 * @brief Color image in BGRA32 format.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
629 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
630 * This format describes a color image. The pixels are stored in 4
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
631 * consecutive bytes. The memory layout is BGRA.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
632 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
633 OrthancPluginPixelFormat_BGRA32 = 10,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
634
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
635 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
636 * @brief Graylevel, unsigned 64bpp image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
637 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
638 * The image is graylevel. Each pixel is unsigned and stored in
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
639 * eight bytes.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
640 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
641 OrthancPluginPixelFormat_Grayscale64 = 11,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
642
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
643 _OrthancPluginPixelFormat_INTERNAL = 0x7fffffff
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
644 } OrthancPluginPixelFormat;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
645
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
646
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
647
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
648 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
649 * The content types that are supported by Orthanc plugins.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
650 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
651 typedef enum
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
652 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
653 OrthancPluginContentType_Unknown = 0, /*!< Unknown content type */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
654 OrthancPluginContentType_Dicom = 1, /*!< DICOM */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
655 OrthancPluginContentType_DicomAsJson = 2, /*!< JSON summary of a DICOM file */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
656
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
657 _OrthancPluginContentType_INTERNAL = 0x7fffffff
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
658 } OrthancPluginContentType;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
659
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
660
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
661
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
662 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
663 * The supported types of DICOM resources.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
664 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
665 typedef enum
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
666 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
667 OrthancPluginResourceType_Patient = 0, /*!< Patient */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
668 OrthancPluginResourceType_Study = 1, /*!< Study */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
669 OrthancPluginResourceType_Series = 2, /*!< Series */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
670 OrthancPluginResourceType_Instance = 3, /*!< Instance */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
671 OrthancPluginResourceType_None = 4, /*!< Unavailable resource type */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
672
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
673 _OrthancPluginResourceType_INTERNAL = 0x7fffffff
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
674 } OrthancPluginResourceType;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
675
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
676
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
677
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
678 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
679 * The supported types of changes that can happen to DICOM resources.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
680 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
681 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
682 typedef enum
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
683 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
684 OrthancPluginChangeType_CompletedSeries = 0, /*!< Series is now complete */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
685 OrthancPluginChangeType_Deleted = 1, /*!< Deleted resource */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
686 OrthancPluginChangeType_NewChildInstance = 2, /*!< A new instance was added to this resource */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
687 OrthancPluginChangeType_NewInstance = 3, /*!< New instance received */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
688 OrthancPluginChangeType_NewPatient = 4, /*!< New patient created */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
689 OrthancPluginChangeType_NewSeries = 5, /*!< New series created */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
690 OrthancPluginChangeType_NewStudy = 6, /*!< New study created */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
691 OrthancPluginChangeType_StablePatient = 7, /*!< Timeout: No new instance in this patient */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
692 OrthancPluginChangeType_StableSeries = 8, /*!< Timeout: No new instance in this series */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
693 OrthancPluginChangeType_StableStudy = 9, /*!< Timeout: No new instance in this study */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
694 OrthancPluginChangeType_OrthancStarted = 10, /*!< Orthanc has started */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
695 OrthancPluginChangeType_OrthancStopped = 11, /*!< Orthanc is stopping */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
696 OrthancPluginChangeType_UpdatedAttachment = 12, /*!< Some user-defined attachment has changed for this resource */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
697 OrthancPluginChangeType_UpdatedMetadata = 13, /*!< Some user-defined metadata has changed for this resource */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
698 OrthancPluginChangeType_UpdatedPeers = 14, /*!< The list of Orthanc peers has changed */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
699 OrthancPluginChangeType_UpdatedModalities = 15, /*!< The list of DICOM modalities has changed */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
700
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
701 _OrthancPluginChangeType_INTERNAL = 0x7fffffff
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
702 } OrthancPluginChangeType;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
703
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
704
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
705 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
706 * The compression algorithms that are supported by the Orthanc core.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
707 * @ingroup Images
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
708 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
709 typedef enum
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
710 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
711 OrthancPluginCompressionType_Zlib = 0, /*!< Standard zlib compression */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
712 OrthancPluginCompressionType_ZlibWithSize = 1, /*!< zlib, prefixed with uncompressed size (uint64_t) */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
713 OrthancPluginCompressionType_Gzip = 2, /*!< Standard gzip compression */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
714 OrthancPluginCompressionType_GzipWithSize = 3, /*!< gzip, prefixed with uncompressed size (uint64_t) */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
715
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
716 _OrthancPluginCompressionType_INTERNAL = 0x7fffffff
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
717 } OrthancPluginCompressionType;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
718
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
719
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
720 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
721 * The image formats that are supported by the Orthanc core.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
722 * @ingroup Images
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
723 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
724 typedef enum
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
725 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
726 OrthancPluginImageFormat_Png = 0, /*!< Image compressed using PNG */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
727 OrthancPluginImageFormat_Jpeg = 1, /*!< Image compressed using JPEG */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
728 OrthancPluginImageFormat_Dicom = 2, /*!< Image compressed using DICOM */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
729
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
730 _OrthancPluginImageFormat_INTERNAL = 0x7fffffff
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
731 } OrthancPluginImageFormat;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
732
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
733
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
734 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
735 * The value representations present in the DICOM standard (version 2013).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
736 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
737 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
738 typedef enum
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
739 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
740 OrthancPluginValueRepresentation_AE = 1, /*!< Application Entity */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
741 OrthancPluginValueRepresentation_AS = 2, /*!< Age String */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
742 OrthancPluginValueRepresentation_AT = 3, /*!< Attribute Tag */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
743 OrthancPluginValueRepresentation_CS = 4, /*!< Code String */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
744 OrthancPluginValueRepresentation_DA = 5, /*!< Date */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
745 OrthancPluginValueRepresentation_DS = 6, /*!< Decimal String */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
746 OrthancPluginValueRepresentation_DT = 7, /*!< Date Time */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
747 OrthancPluginValueRepresentation_FD = 8, /*!< Floating Point Double */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
748 OrthancPluginValueRepresentation_FL = 9, /*!< Floating Point Single */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
749 OrthancPluginValueRepresentation_IS = 10, /*!< Integer String */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
750 OrthancPluginValueRepresentation_LO = 11, /*!< Long String */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
751 OrthancPluginValueRepresentation_LT = 12, /*!< Long Text */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
752 OrthancPluginValueRepresentation_OB = 13, /*!< Other Byte String */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
753 OrthancPluginValueRepresentation_OF = 14, /*!< Other Float String */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
754 OrthancPluginValueRepresentation_OW = 15, /*!< Other Word String */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
755 OrthancPluginValueRepresentation_PN = 16, /*!< Person Name */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
756 OrthancPluginValueRepresentation_SH = 17, /*!< Short String */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
757 OrthancPluginValueRepresentation_SL = 18, /*!< Signed Long */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
758 OrthancPluginValueRepresentation_SQ = 19, /*!< Sequence of Items */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
759 OrthancPluginValueRepresentation_SS = 20, /*!< Signed Short */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
760 OrthancPluginValueRepresentation_ST = 21, /*!< Short Text */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
761 OrthancPluginValueRepresentation_TM = 22, /*!< Time */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
762 OrthancPluginValueRepresentation_UI = 23, /*!< Unique Identifier (UID) */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
763 OrthancPluginValueRepresentation_UL = 24, /*!< Unsigned Long */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
764 OrthancPluginValueRepresentation_UN = 25, /*!< Unknown */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
765 OrthancPluginValueRepresentation_US = 26, /*!< Unsigned Short */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
766 OrthancPluginValueRepresentation_UT = 27, /*!< Unlimited Text */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
767
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
768 _OrthancPluginValueRepresentation_INTERNAL = 0x7fffffff
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
769 } OrthancPluginValueRepresentation;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
770
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
771
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
772 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
773 * The possible output formats for a DICOM-to-JSON conversion.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
774 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
775 * @see OrthancPluginDicomToJson()
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
776 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
777 typedef enum
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
778 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
779 OrthancPluginDicomToJsonFormat_Full = 1, /*!< Full output, with most details */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
780 OrthancPluginDicomToJsonFormat_Short = 2, /*!< Tags output as hexadecimal numbers */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
781 OrthancPluginDicomToJsonFormat_Human = 3, /*!< Human-readable JSON */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
782
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
783 _OrthancPluginDicomToJsonFormat_INTERNAL = 0x7fffffff
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
784 } OrthancPluginDicomToJsonFormat;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
785
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
786
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
787 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
788 * Flags to customize a DICOM-to-JSON conversion. By default, binary
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
789 * tags are formatted using Data URI scheme.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
790 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
791 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
792 typedef enum
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
793 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
794 OrthancPluginDicomToJsonFlags_None = 0,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
795 OrthancPluginDicomToJsonFlags_IncludeBinary = (1 << 0), /*!< Include the binary tags */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
796 OrthancPluginDicomToJsonFlags_IncludePrivateTags = (1 << 1), /*!< Include the private tags */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
797 OrthancPluginDicomToJsonFlags_IncludeUnknownTags = (1 << 2), /*!< Include the tags unknown by the dictionary */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
798 OrthancPluginDicomToJsonFlags_IncludePixelData = (1 << 3), /*!< Include the pixel data */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
799 OrthancPluginDicomToJsonFlags_ConvertBinaryToAscii = (1 << 4), /*!< Output binary tags as-is, dropping non-ASCII */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
800 OrthancPluginDicomToJsonFlags_ConvertBinaryToNull = (1 << 5), /*!< Signal binary tags as null values */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
801
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
802 _OrthancPluginDicomToJsonFlags_INTERNAL = 0x7fffffff
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
803 } OrthancPluginDicomToJsonFlags;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
804
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
805
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
806 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
807 * Flags to the creation of a DICOM file.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
808 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
809 * @see OrthancPluginCreateDicom()
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
810 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
811 typedef enum
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
812 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
813 OrthancPluginCreateDicomFlags_None = 0,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
814 OrthancPluginCreateDicomFlags_DecodeDataUriScheme = (1 << 0), /*!< Decode fields encoded using data URI scheme */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
815 OrthancPluginCreateDicomFlags_GenerateIdentifiers = (1 << 1), /*!< Automatically generate DICOM identifiers */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
816
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
817 _OrthancPluginCreateDicomFlags_INTERNAL = 0x7fffffff
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
818 } OrthancPluginCreateDicomFlags;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
819
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
820
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
821 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
822 * The constraints on the DICOM identifiers that must be supported
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
823 * by the database plugins.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
824 * @deprecated Plugins using OrthancPluginConstraintType will be faster
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
825 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
826 typedef enum
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
827 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
828 OrthancPluginIdentifierConstraint_Equal = 1, /*!< Equal */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
829 OrthancPluginIdentifierConstraint_SmallerOrEqual = 2, /*!< Less or equal */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
830 OrthancPluginIdentifierConstraint_GreaterOrEqual = 3, /*!< More or equal */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
831 OrthancPluginIdentifierConstraint_Wildcard = 4, /*!< Case-sensitive wildcard matching (with * and ?) */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
832
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
833 _OrthancPluginIdentifierConstraint_INTERNAL = 0x7fffffff
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
834 } OrthancPluginIdentifierConstraint;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
835
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
836
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
837 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
838 * The constraints on the tags (main DICOM tags and identifier tags)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
839 * that must be supported by the database plugins.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
840 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
841 typedef enum
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
842 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
843 OrthancPluginConstraintType_Equal = 1, /*!< Equal */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
844 OrthancPluginConstraintType_SmallerOrEqual = 2, /*!< Less or equal */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
845 OrthancPluginConstraintType_GreaterOrEqual = 3, /*!< More or equal */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
846 OrthancPluginConstraintType_Wildcard = 4, /*!< Wildcard matching */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
847 OrthancPluginConstraintType_List = 5, /*!< List of values */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
848
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
849 _OrthancPluginConstraintType_INTERNAL = 0x7fffffff
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
850 } OrthancPluginConstraintType;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
851
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
852
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
853 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
854 * The origin of a DICOM instance that has been received by Orthanc.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
855 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
856 typedef enum
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
857 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
858 OrthancPluginInstanceOrigin_Unknown = 1, /*!< Unknown origin */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
859 OrthancPluginInstanceOrigin_DicomProtocol = 2, /*!< Instance received through DICOM protocol */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
860 OrthancPluginInstanceOrigin_RestApi = 3, /*!< Instance received through REST API of Orthanc */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
861 OrthancPluginInstanceOrigin_Plugin = 4, /*!< Instance added to Orthanc by a plugin */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
862 OrthancPluginInstanceOrigin_Lua = 5, /*!< Instance added to Orthanc by a Lua script */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
863
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
864 _OrthancPluginInstanceOrigin_INTERNAL = 0x7fffffff
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
865 } OrthancPluginInstanceOrigin;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
866
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
867
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
868 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
869 * The possible status for one single step of a job.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
870 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
871 typedef enum
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
872 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
873 OrthancPluginJobStepStatus_Success = 1, /*!< The job has successfully executed all its steps */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
874 OrthancPluginJobStepStatus_Failure = 2, /*!< The job has failed while executing this step */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
875 OrthancPluginJobStepStatus_Continue = 3 /*!< The job has still data to process after this step */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
876 } OrthancPluginJobStepStatus;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
877
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
878
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
879 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
880 * Explains why the job should stop and release the resources it has
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
881 * allocated. This is especially important to disambiguate between
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
882 * the "paused" condition and the "final" conditions (success,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
883 * failure, or canceled).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
884 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
885 typedef enum
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
886 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
887 OrthancPluginJobStopReason_Success = 1, /*!< The job has succeeded */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
888 OrthancPluginJobStopReason_Paused = 2, /*!< The job was paused, and will be resumed later */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
889 OrthancPluginJobStopReason_Failure = 3, /*!< The job has failed, and might be resubmitted later */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
890 OrthancPluginJobStopReason_Canceled = 4 /*!< The job was canceled, and might be resubmitted later */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
891 } OrthancPluginJobStopReason;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
892
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
893
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
894 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
895 * @brief A memory buffer allocated by the core system of Orthanc.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
896 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
897 * A memory buffer allocated by the core system of Orthanc. When the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
898 * content of the buffer is not useful anymore, it must be free by a
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
899 * call to ::OrthancPluginFreeMemoryBuffer().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
900 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
901 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
902 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
903 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
904 * @brief The content of the buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
905 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
906 void* data;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
907
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
908 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
909 * @brief The number of bytes in the buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
910 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
911 uint32_t size;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
912 } OrthancPluginMemoryBuffer;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
913
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
914
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
915
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
916
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
917 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
918 * @brief Opaque structure that represents the HTTP connection to the client application.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
919 * @ingroup Callback
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
920 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
921 typedef struct _OrthancPluginRestOutput_t OrthancPluginRestOutput;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
922
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
923
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
924
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
925 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
926 * @brief Opaque structure that represents a DICOM instance received by Orthanc.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
927 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
928 typedef struct _OrthancPluginDicomInstance_t OrthancPluginDicomInstance;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
929
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
930
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
931
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
932 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
933 * @brief Opaque structure that represents an image that is uncompressed in memory.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
934 * @ingroup Images
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
935 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
936 typedef struct _OrthancPluginImage_t OrthancPluginImage;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
937
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
938
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
939
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
940 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
941 * @brief Opaque structure that represents the storage area that is actually used by Orthanc.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
942 * @ingroup Images
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
943 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
944 typedef struct _OrthancPluginStorageArea_t OrthancPluginStorageArea;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
945
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
946
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
947
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
948 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
949 * @brief Opaque structure to an object that represents a C-Find query for worklists.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
950 * @ingroup DicomCallbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
951 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
952 typedef struct _OrthancPluginWorklistQuery_t OrthancPluginWorklistQuery;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
953
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
954
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
955
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
956 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
957 * @brief Opaque structure to an object that represents the answers to a C-Find query for worklists.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
958 * @ingroup DicomCallbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
959 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
960 typedef struct _OrthancPluginWorklistAnswers_t OrthancPluginWorklistAnswers;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
961
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
962
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
963
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
964 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
965 * @brief Opaque structure to an object that represents a C-Find query.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
966 * @ingroup DicomCallbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
967 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
968 typedef struct _OrthancPluginFindQuery_t OrthancPluginFindQuery;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
969
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
970
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
971
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
972 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
973 * @brief Opaque structure to an object that represents the answers to a C-Find query for worklists.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
974 * @ingroup DicomCallbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
975 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
976 typedef struct _OrthancPluginFindAnswers_t OrthancPluginFindAnswers;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
977
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
978
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
979
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
980 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
981 * @brief Opaque structure to an object that can be used to check whether a DICOM instance matches a C-Find query.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
982 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
983 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
984 typedef struct _OrthancPluginFindAnswers_t OrthancPluginFindMatcher;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
985
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
986
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
987
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
988 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
989 * @brief Opaque structure to the set of remote Orthanc Peers that are known to the local Orthanc server.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
990 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
991 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
992 typedef struct _OrthancPluginPeers_t OrthancPluginPeers;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
993
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
994
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
995
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
996 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
997 * @brief Opaque structure to a job to be executed by Orthanc.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
998 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
999 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1000 typedef struct _OrthancPluginJob_t OrthancPluginJob;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1001
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1002
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1003
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1004 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1005 * @brief Signature of a callback function that answers to a REST request.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1006 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1007 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1008 typedef OrthancPluginErrorCode (*OrthancPluginRestCallback) (
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1009 OrthancPluginRestOutput* output,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1010 const char* url,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1011 const OrthancPluginHttpRequest* request);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1012
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1013
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1014
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1015 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1016 * @brief Signature of a callback function that is triggered when Orthanc receives a DICOM instance.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1017 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1018 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1019 typedef OrthancPluginErrorCode (*OrthancPluginOnStoredInstanceCallback) (
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1020 OrthancPluginDicomInstance* instance,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1021 const char* instanceId);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1022
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1023
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1024
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1025 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1026 * @brief Signature of a callback function that is triggered when a change happens to some DICOM resource.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1027 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1028 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1029 typedef OrthancPluginErrorCode (*OrthancPluginOnChangeCallback) (
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1030 OrthancPluginChangeType changeType,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1031 OrthancPluginResourceType resourceType,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1032 const char* resourceId);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1033
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1034
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1035
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1036 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1037 * @brief Signature of a callback function to decode a DICOM instance as an image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1038 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1039 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1040 typedef OrthancPluginErrorCode (*OrthancPluginDecodeImageCallback) (
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1041 OrthancPluginImage** target,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1042 const void* dicom,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1043 const uint32_t size,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1044 uint32_t frameIndex);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1045
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1046
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1047
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1048 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1049 * @brief Signature of a function to free dynamic memory.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1050 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1051 typedef void (*OrthancPluginFree) (void* buffer);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1052
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1053
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1054
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1055 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1056 * @brief Callback for writing to the storage area.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1057 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1058 * Signature of a callback function that is triggered when Orthanc writes a file to the storage area.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1059 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1060 * @param uuid The UUID of the file.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1061 * @param content The content of the file.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1062 * @param size The size of the file.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1063 * @param type The content type corresponding to this file.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1064 * @return 0 if success, other value if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1065 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1066 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1067 typedef OrthancPluginErrorCode (*OrthancPluginStorageCreate) (
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1068 const char* uuid,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1069 const void* content,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1070 int64_t size,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1071 OrthancPluginContentType type);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1072
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1073
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1074
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1075 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1076 * @brief Callback for reading from the storage area.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1077 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1078 * Signature of a callback function that is triggered when Orthanc reads a file from the storage area.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1079 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1080 * @param content The content of the file (output).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1081 * @param size The size of the file (output).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1082 * @param uuid The UUID of the file of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1083 * @param type The content type corresponding to this file.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1084 * @return 0 if success, other value if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1085 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1086 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1087 typedef OrthancPluginErrorCode (*OrthancPluginStorageRead) (
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1088 void** content,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1089 int64_t* size,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1090 const char* uuid,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1091 OrthancPluginContentType type);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1092
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1093
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1094
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1095 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1096 * @brief Callback for removing a file from the storage area.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1097 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1098 * Signature of a callback function that is triggered when Orthanc deletes a file from the storage area.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1099 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1100 * @param uuid The UUID of the file to be removed.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1101 * @param type The content type corresponding to this file.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1102 * @return 0 if success, other value if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1103 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1104 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1105 typedef OrthancPluginErrorCode (*OrthancPluginStorageRemove) (
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1106 const char* uuid,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1107 OrthancPluginContentType type);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1108
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1109
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1110
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1111 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1112 * @brief Callback to handle the C-Find SCP requests for worklists.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1113 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1114 * Signature of a callback function that is triggered when Orthanc
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1115 * receives a C-Find SCP request against modality worklists.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1116 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1117 * @param answers The target structure where answers must be stored.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1118 * @param query The worklist query.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1119 * @param issuerAet The Application Entity Title (AET) of the modality from which the request originates.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1120 * @param calledAet The Application Entity Title (AET) of the modality that is called by the request.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1121 * @return 0 if success, other value if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1122 * @ingroup DicomCallbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1123 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1124 typedef OrthancPluginErrorCode (*OrthancPluginWorklistCallback) (
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1125 OrthancPluginWorklistAnswers* answers,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1126 const OrthancPluginWorklistQuery* query,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1127 const char* issuerAet,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1128 const char* calledAet);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1129
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1130
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1131
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1132 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1133 * @brief Callback to filter incoming HTTP requests received by Orthanc.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1134 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1135 * Signature of a callback function that is triggered whenever
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1136 * Orthanc receives an HTTP/REST request, and that answers whether
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1137 * this request should be allowed. If the callback returns "0"
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1138 * ("false"), the server answers with HTTP status code 403
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1139 * (Forbidden).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1140 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1141 * @param method The HTTP method used by the request.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1142 * @param uri The URI of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1143 * @param ip The IP address of the HTTP client.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1144 * @param headersCount The number of HTTP headers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1145 * @param headersKeys The keys of the HTTP headers (always converted to low-case).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1146 * @param headersValues The values of the HTTP headers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1147 * @return 0 if forbidden access, 1 if allowed access, -1 if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1148 * @ingroup Callback
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1149 * @deprecated Please instead use OrthancPluginIncomingHttpRequestFilter2()
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1150 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1151 typedef int32_t (*OrthancPluginIncomingHttpRequestFilter) (
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1152 OrthancPluginHttpMethod method,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1153 const char* uri,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1154 const char* ip,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1155 uint32_t headersCount,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1156 const char* const* headersKeys,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1157 const char* const* headersValues);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1158
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1159
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1160
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1161 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1162 * @brief Callback to filter incoming HTTP requests received by Orthanc.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1163 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1164 * Signature of a callback function that is triggered whenever
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1165 * Orthanc receives an HTTP/REST request, and that answers whether
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1166 * this request should be allowed. If the callback returns "0"
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1167 * ("false"), the server answers with HTTP status code 403
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1168 * (Forbidden).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1169 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1170 * @param method The HTTP method used by the request.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1171 * @param uri The URI of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1172 * @param ip The IP address of the HTTP client.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1173 * @param headersCount The number of HTTP headers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1174 * @param headersKeys The keys of the HTTP headers (always converted to low-case).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1175 * @param headersValues The values of the HTTP headers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1176 * @param getArgumentsCount The number of GET arguments (only for the GET HTTP method).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1177 * @param getArgumentsKeys The keys of the GET arguments (only for the GET HTTP method).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1178 * @param getArgumentsValues The values of the GET arguments (only for the GET HTTP method).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1179 * @return 0 if forbidden access, 1 if allowed access, -1 if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1180 * @ingroup Callback
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1181 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1182 typedef int32_t (*OrthancPluginIncomingHttpRequestFilter2) (
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1183 OrthancPluginHttpMethod method,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1184 const char* uri,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1185 const char* ip,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1186 uint32_t headersCount,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1187 const char* const* headersKeys,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1188 const char* const* headersValues,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1189 uint32_t getArgumentsCount,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1190 const char* const* getArgumentsKeys,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1191 const char* const* getArgumentsValues);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1192
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1193
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1194
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1195 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1196 * @brief Callback to handle incoming C-Find SCP requests.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1197 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1198 * Signature of a callback function that is triggered whenever
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1199 * Orthanc receives a C-Find SCP request not concerning modality
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1200 * worklists.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1201 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1202 * @param answers The target structure where answers must be stored.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1203 * @param query The worklist query.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1204 * @param issuerAet The Application Entity Title (AET) of the modality from which the request originates.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1205 * @param calledAet The Application Entity Title (AET) of the modality that is called by the request.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1206 * @return 0 if success, other value if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1207 * @ingroup DicomCallbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1208 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1209 typedef OrthancPluginErrorCode (*OrthancPluginFindCallback) (
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1210 OrthancPluginFindAnswers* answers,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1211 const OrthancPluginFindQuery* query,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1212 const char* issuerAet,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1213 const char* calledAet);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1214
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1215
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1216
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1217 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1218 * @brief Callback to handle incoming C-Move SCP requests.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1219 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1220 * Signature of a callback function that is triggered whenever
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1221 * Orthanc receives a C-Move SCP request. The callback receives the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1222 * type of the resource of interest (study, series, instance...)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1223 * together with the DICOM tags containing its identifiers. In turn,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1224 * the plugin must create a driver object that will be responsible
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1225 * for driving the successive move suboperations.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1226 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1227 * @param resourceType The type of the resource of interest. Note
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1228 * that this might be set to ResourceType_None if the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1229 * QueryRetrieveLevel (0008,0052) tag was not provided by the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1230 * issuer (i.e. the originator modality).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1231 * @param patientId Content of the PatientID (0x0010, 0x0020) tag of the resource of interest. Might be NULL.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1232 * @param accessionNumber Content of the AccessionNumber (0x0008, 0x0050) tag. Might be NULL.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1233 * @param studyInstanceUid Content of the StudyInstanceUID (0x0020, 0x000d) tag. Might be NULL.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1234 * @param seriesInstanceUid Content of the SeriesInstanceUID (0x0020, 0x000e) tag. Might be NULL.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1235 * @param sopInstanceUid Content of the SOPInstanceUID (0x0008, 0x0018) tag. Might be NULL.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1236 * @param originatorAet The Application Entity Title (AET) of the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1237 * modality from which the request originates.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1238 * @param sourceAet The Application Entity Title (AET) of the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1239 * modality that should send its DICOM files to another modality.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1240 * @param targetAet The Application Entity Title (AET) of the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1241 * modality that should receive the DICOM files.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1242 * @param originatorId The Message ID issued by the originator modality,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1243 * as found in tag (0000,0110) of the DICOM query emitted by the issuer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1244 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1245 * @return The NULL value if the plugin cannot deal with this query,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1246 * or a pointer to the driver object that is responsible for
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1247 * handling the successive move suboperations.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1248 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1249 * @note If targetAet equals sourceAet, this is actually a query/retrieve operation.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1250 * @ingroup DicomCallbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1251 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1252 typedef void* (*OrthancPluginMoveCallback) (
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1253 OrthancPluginResourceType resourceType,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1254 const char* patientId,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1255 const char* accessionNumber,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1256 const char* studyInstanceUid,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1257 const char* seriesInstanceUid,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1258 const char* sopInstanceUid,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1259 const char* originatorAet,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1260 const char* sourceAet,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1261 const char* targetAet,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1262 uint16_t originatorId);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1263
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1264
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1265 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1266 * @brief Callback to read the size of a C-Move driver.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1267 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1268 * Signature of a callback function that returns the number of
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1269 * C-Move suboperations that are to be achieved by the given C-Move
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1270 * driver. This driver is the return value of a previous call to the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1271 * OrthancPluginMoveCallback() callback.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1272 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1273 * @param moveDriver The C-Move driver of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1274 * @return The number of suboperations.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1275 * @ingroup DicomCallbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1276 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1277 typedef uint32_t (*OrthancPluginGetMoveSize) (void* moveDriver);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1278
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1279
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1280 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1281 * @brief Callback to apply one C-Move suboperation.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1282 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1283 * Signature of a callback function that applies the next C-Move
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1284 * suboperation that os to be achieved by the given C-Move
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1285 * driver. This driver is the return value of a previous call to the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1286 * OrthancPluginMoveCallback() callback.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1287 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1288 * @param moveDriver The C-Move driver of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1289 * @return 0 if success, or the error code if failure.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1290 * @ingroup DicomCallbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1291 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1292 typedef OrthancPluginErrorCode (*OrthancPluginApplyMove) (void* moveDriver);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1293
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1294
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1295 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1296 * @brief Callback to free one C-Move driver.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1297 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1298 * Signature of a callback function that releases the resources
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1299 * allocated by the given C-Move driver. This driver is the return
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1300 * value of a previous call to the OrthancPluginMoveCallback()
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1301 * callback.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1302 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1303 * @param moveDriver The C-Move driver of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1304 * @ingroup DicomCallbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1305 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1306 typedef void (*OrthancPluginFreeMove) (void* moveDriver);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1307
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1308
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1309 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1310 * @brief Callback to finalize one custom job.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1311 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1312 * Signature of a callback function that releases all the resources
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1313 * allocated by the given job. This job is the argument provided to
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1314 * OrthancPluginCreateJob().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1315 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1316 * @param job The job of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1317 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1318 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1319 typedef void (*OrthancPluginJobFinalize) (void* job);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1320
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1321
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1322 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1323 * @brief Callback to check the progress of one custom job.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1324 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1325 * Signature of a callback function that returns the progress of the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1326 * job.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1327 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1328 * @param job The job of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1329 * @return The progress, as a floating-point number ranging from 0 to 1.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1330 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1331 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1332 typedef float (*OrthancPluginJobGetProgress) (void* job);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1333
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1334
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1335 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1336 * @brief Callback to retrieve the content of one custom job.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1337 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1338 * Signature of a callback function that returns human-readable
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1339 * statistics about the job. This statistics must be formatted as a
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1340 * JSON object. This information is notably displayed in the "Jobs"
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1341 * tab of "Orthanc Explorer".
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1342 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1343 * @param job The job of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1344 * @return The statistics, as a JSON object encoded as a string.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1345 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1346 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1347 typedef const char* (*OrthancPluginJobGetContent) (void* job);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1348
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1349
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1350 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1351 * @brief Callback to serialize one custom job.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1352 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1353 * Signature of a callback function that returns a serialized
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1354 * version of the job, formatted as a JSON object. This
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1355 * serialization is stored in the Orthanc database, and is used to
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1356 * reload the job on the restart of Orthanc. The "unserialization"
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1357 * callback (with OrthancPluginJobsUnserializer signature) will
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1358 * receive this serialized object.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1359 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1360 * @param job The job of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1361 * @return The serialized job, as a JSON object encoded as a string.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1362 * @see OrthancPluginRegisterJobsUnserializer()
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1363 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1364 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1365 typedef const char* (*OrthancPluginJobGetSerialized) (void* job);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1366
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1367
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1368 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1369 * @brief Callback to execute one step of a custom job.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1370 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1371 * Signature of a callback function that executes one step in the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1372 * job. The jobs engine of Orthanc will make successive calls to
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1373 * this method, as long as it returns
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1374 * OrthancPluginJobStepStatus_Continue.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1375 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1376 * @param job The job of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1377 * @return The status of execution.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1378 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1379 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1380 typedef OrthancPluginJobStepStatus (*OrthancPluginJobStep) (void* job);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1381
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1382
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1383 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1384 * @brief Callback executed once one custom job leaves the "running" state.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1385 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1386 * Signature of a callback function that is invoked once a job
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1387 * leaves the "running" state. This can happen if the previous call
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1388 * to OrthancPluginJobStep has failed/succeeded, if the host Orthanc
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1389 * server is being stopped, or if the user manually tags the job as
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1390 * paused/canceled. This callback allows the plugin to free
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1391 * resources allocated for running this custom job (e.g. to stop
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1392 * threads, or to remove temporary files).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1393 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1394 * Note that handling pauses might involves a specific treatment
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1395 * (such a stopping threads, but keeping temporary files on the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1396 * disk). This "paused" situation can be checked by looking at the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1397 * "reason" parameter.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1398 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1399 * @param job The job of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1400 * @param reason The reason for leaving the "running" state.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1401 * @return 0 if success, or the error code if failure.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1402 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1403 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1404 typedef OrthancPluginErrorCode (*OrthancPluginJobStop) (void* job,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1405 OrthancPluginJobStopReason reason);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1406
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1407
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1408 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1409 * @brief Callback executed once one stopped custom job is started again.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1410 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1411 * Signature of a callback function that is invoked once a job
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1412 * leaves the "failure/canceled" state, to be started again. This
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1413 * function will typically reset the progress to zero. Note that
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1414 * before being actually executed, the job would first be tagged as
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1415 * "pending" in the Orthanc jobs engine.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1416 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1417 * @param job The job of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1418 * @return 0 if success, or the error code if failure.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1419 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1420 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1421 typedef OrthancPluginErrorCode (*OrthancPluginJobReset) (void* job);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1422
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1423
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1424 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1425 * @brief Callback executed to unserialized a custom job.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1426 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1427 * Signature of a callback function that unserializes a job that was
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1428 * saved in the Orthanc database.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1429 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1430 * @param jobType The type of the job, as provided to OrthancPluginCreateJob().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1431 * @param serialized The serialization of the job, as provided by OrthancPluginJobGetSerialized.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1432 * @return The unserialized job (as created by OrthancPluginCreateJob()), or NULL
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1433 * if this unserializer cannot handle this job type.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1434 * @see OrthancPluginRegisterJobsUnserializer()
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1435 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1436 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1437 typedef OrthancPluginJob* (*OrthancPluginJobsUnserializer) (const char* jobType,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1438 const char* serialized);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1439
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1440
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1441
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1442 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1443 * @brief Data structure that contains information about the Orthanc core.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1444 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1445 typedef struct _OrthancPluginContext_t
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1446 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1447 void* pluginsManager;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1448 const char* orthancVersion;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1449 OrthancPluginFree Free;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1450 OrthancPluginErrorCode (*InvokeService) (struct _OrthancPluginContext_t* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1451 _OrthancPluginService service,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1452 const void* params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1453 } OrthancPluginContext;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1454
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1455
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1456
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1457 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1458 * @brief An entry in the dictionary of DICOM tags.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1459 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1460 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1461 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1462 uint16_t group; /*!< The group of the tag */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1463 uint16_t element; /*!< The element of the tag */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1464 OrthancPluginValueRepresentation vr; /*!< The value representation of the tag */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1465 uint32_t minMultiplicity; /*!< The minimum multiplicity of the tag */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1466 uint32_t maxMultiplicity; /*!< The maximum multiplicity of the tag (0 means arbitrary) */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1467 } OrthancPluginDictionaryEntry;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1468
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1469
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1470
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1471 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1472 * @brief Free a string.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1473 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1474 * Free a string that was allocated by the core system of Orthanc.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1475 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1476 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1477 * @param str The string to be freed.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1478 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1479 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeString(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1480 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1481 char* str)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1482 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1483 if (str != NULL)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1484 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1485 context->Free(str);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1486 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1487 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1488
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1489
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1490 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1491 * @brief Check that the version of the hosting Orthanc is above a given version.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1492 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1493 * This function checks whether the version of the Orthanc server
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1494 * running this plugin, is above the given version. Contrarily to
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1495 * OrthancPluginCheckVersion(), it is up to the developer of the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1496 * plugin to make sure that all the Orthanc SDK services called by
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1497 * the plugin are actually implemented in the given version of
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1498 * Orthanc.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1499 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1500 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1501 * @param expectedMajor Expected major version.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1502 * @param expectedMinor Expected minor version.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1503 * @param expectedRevision Expected revision.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1504 * @return 1 if and only if the versions are compatible. If the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1505 * result is 0, the initialization of the plugin should fail.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1506 * @see OrthancPluginCheckVersion
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1507 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1508 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1509 ORTHANC_PLUGIN_INLINE int OrthancPluginCheckVersionAdvanced(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1510 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1511 int expectedMajor,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1512 int expectedMinor,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1513 int expectedRevision)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1514 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1515 int major, minor, revision;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1516
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1517 if (sizeof(int32_t) != sizeof(OrthancPluginErrorCode) ||
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1518 sizeof(int32_t) != sizeof(OrthancPluginHttpMethod) ||
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1519 sizeof(int32_t) != sizeof(_OrthancPluginService) ||
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1520 sizeof(int32_t) != sizeof(_OrthancPluginProperty) ||
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1521 sizeof(int32_t) != sizeof(OrthancPluginPixelFormat) ||
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1522 sizeof(int32_t) != sizeof(OrthancPluginContentType) ||
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1523 sizeof(int32_t) != sizeof(OrthancPluginResourceType) ||
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1524 sizeof(int32_t) != sizeof(OrthancPluginChangeType) ||
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1525 sizeof(int32_t) != sizeof(OrthancPluginCompressionType) ||
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1526 sizeof(int32_t) != sizeof(OrthancPluginImageFormat) ||
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1527 sizeof(int32_t) != sizeof(OrthancPluginValueRepresentation) ||
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1528 sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFormat) ||
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1529 sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFlags) ||
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1530 sizeof(int32_t) != sizeof(OrthancPluginCreateDicomFlags) ||
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1531 sizeof(int32_t) != sizeof(OrthancPluginIdentifierConstraint) ||
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1532 sizeof(int32_t) != sizeof(OrthancPluginInstanceOrigin) ||
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1533 sizeof(int32_t) != sizeof(OrthancPluginJobStepStatus) ||
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1534 sizeof(int32_t) != sizeof(OrthancPluginConstraintType))
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1535 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1536 /* Mismatch in the size of the enumerations */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1537 return 0;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1538 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1539
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1540 /* Assume compatibility with the mainline */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1541 if (!strcmp(context->orthancVersion, "mainline"))
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1542 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1543 return 1;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1544 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1545
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1546 /* Parse the version of the Orthanc core */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1547 if (
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1548 #ifdef _MSC_VER
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1549 sscanf_s
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1550 #else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1551 sscanf
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1552 #endif
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1553 (context->orthancVersion, "%4d.%4d.%4d", &major, &minor, &revision) != 3)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1554 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1555 return 0;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1556 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1557
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1558 /* Check the major number of the version */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1559
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1560 if (major > expectedMajor)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1561 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1562 return 1;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1563 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1564
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1565 if (major < expectedMajor)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1566 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1567 return 0;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1568 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1569
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1570 /* Check the minor number of the version */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1571
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1572 if (minor > expectedMinor)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1573 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1574 return 1;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1575 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1576
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1577 if (minor < expectedMinor)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1578 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1579 return 0;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1580 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1581
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1582 /* Check the revision number of the version */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1583
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1584 if (revision >= expectedRevision)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1585 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1586 return 1;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1587 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1588 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1589 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1590 return 0;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1591 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1592 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1593
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1594
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1595 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1596 * @brief Check the compatibility of the plugin wrt. the version of its hosting Orthanc.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1597 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1598 * This function checks whether the version of the Orthanc server
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1599 * running this plugin, is above the version of the current Orthanc
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1600 * SDK header. This guarantees that the plugin is compatible with
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1601 * the hosting Orthanc (i.e. it will not call unavailable services).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1602 * The result of this function should always be checked in the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1603 * OrthancPluginInitialize() entry point of the plugin.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1604 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1605 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1606 * @return 1 if and only if the versions are compatible. If the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1607 * result is 0, the initialization of the plugin should fail.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1608 * @see OrthancPluginCheckVersionAdvanced
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1609 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1610 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1611 ORTHANC_PLUGIN_INLINE int OrthancPluginCheckVersion(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1612 OrthancPluginContext* context)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1613 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1614 return OrthancPluginCheckVersionAdvanced(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1615 context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1616 ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1617 ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1618 ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1619 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1620
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1621
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1622 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1623 * @brief Free a memory buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1624 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1625 * Free a memory buffer that was allocated by the core system of Orthanc.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1626 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1627 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1628 * @param buffer The memory buffer to release.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1629 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1630 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeMemoryBuffer(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1631 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1632 OrthancPluginMemoryBuffer* buffer)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1633 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1634 context->Free(buffer->data);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1635 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1636
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1637
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1638 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1639 * @brief Log an error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1640 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1641 * Log an error message using the Orthanc logging system.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1642 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1643 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1644 * @param message The message to be logged.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1645 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1646 ORTHANC_PLUGIN_INLINE void OrthancPluginLogError(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1647 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1648 const char* message)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1649 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1650 context->InvokeService(context, _OrthancPluginService_LogError, message);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1651 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1652
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1653
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1654 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1655 * @brief Log a warning.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1656 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1657 * Log a warning message using the Orthanc logging system.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1658 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1659 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1660 * @param message The message to be logged.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1661 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1662 ORTHANC_PLUGIN_INLINE void OrthancPluginLogWarning(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1663 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1664 const char* message)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1665 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1666 context->InvokeService(context, _OrthancPluginService_LogWarning, message);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1667 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1668
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1669
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1670 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1671 * @brief Log an information.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1672 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1673 * Log an information message using the Orthanc logging system.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1674 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1675 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1676 * @param message The message to be logged.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1677 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1678 ORTHANC_PLUGIN_INLINE void OrthancPluginLogInfo(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1679 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1680 const char* message)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1681 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1682 context->InvokeService(context, _OrthancPluginService_LogInfo, message);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1683 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1684
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1685
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1686
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1687 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1688 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1689 const char* pathRegularExpression;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1690 OrthancPluginRestCallback callback;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1691 } _OrthancPluginRestCallback;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1692
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1693 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1694 * @brief Register a REST callback.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1695 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1696 * This function registers a REST callback against a regular
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1697 * expression for a URI. This function must be called during the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1698 * initialization of the plugin, i.e. inside the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1699 * OrthancPluginInitialize() public function.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1700 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1701 * Each REST callback is guaranteed to run in mutual exclusion.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1702 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1703 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1704 * @param pathRegularExpression Regular expression for the URI. May contain groups.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1705 * @param callback The callback function to handle the REST call.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1706 * @see OrthancPluginRegisterRestCallbackNoLock()
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1707 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1708 * @note
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1709 * The regular expression is case sensitive and must follow the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1710 * [Perl syntax](https://www.boost.org/doc/libs/1_67_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1711 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1712 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1713 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1714 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallback(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1715 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1716 const char* pathRegularExpression,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1717 OrthancPluginRestCallback callback)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1718 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1719 _OrthancPluginRestCallback params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1720 params.pathRegularExpression = pathRegularExpression;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1721 params.callback = callback;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1722 context->InvokeService(context, _OrthancPluginService_RegisterRestCallback, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1723 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1724
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1725
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1726
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1727 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1728 * @brief Register a REST callback, without locking.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1729 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1730 * This function registers a REST callback against a regular
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1731 * expression for a URI. This function must be called during the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1732 * initialization of the plugin, i.e. inside the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1733 * OrthancPluginInitialize() public function.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1734 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1735 * Contrarily to OrthancPluginRegisterRestCallback(), the callback
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1736 * will NOT be invoked in mutual exclusion. This can be useful for
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1737 * high-performance plugins that must handle concurrent requests
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1738 * (Orthanc uses a pool of threads, one thread being assigned to
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1739 * each incoming HTTP request). Of course, if using this function,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1740 * it is up to the plugin to implement the required locking
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1741 * mechanisms.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1742 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1743 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1744 * @param pathRegularExpression Regular expression for the URI. May contain groups.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1745 * @param callback The callback function to handle the REST call.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1746 * @see OrthancPluginRegisterRestCallback()
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1747 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1748 * @note
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1749 * The regular expression is case sensitive and must follow the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1750 * [Perl syntax](https://www.boost.org/doc/libs/1_67_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1751 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1752 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1753 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1754 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallbackNoLock(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1755 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1756 const char* pathRegularExpression,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1757 OrthancPluginRestCallback callback)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1758 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1759 _OrthancPluginRestCallback params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1760 params.pathRegularExpression = pathRegularExpression;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1761 params.callback = callback;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1762 context->InvokeService(context, _OrthancPluginService_RegisterRestCallbackNoLock, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1763 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1764
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1765
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1766
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1767 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1768 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1769 OrthancPluginOnStoredInstanceCallback callback;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1770 } _OrthancPluginOnStoredInstanceCallback;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1771
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1772 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1773 * @brief Register a callback for received instances.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1774 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1775 * This function registers a callback function that is called
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1776 * whenever a new DICOM instance is stored into the Orthanc core.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1777 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1778 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1779 * @param callback The callback function.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1780 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1781 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1782 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnStoredInstanceCallback(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1783 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1784 OrthancPluginOnStoredInstanceCallback callback)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1785 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1786 _OrthancPluginOnStoredInstanceCallback params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1787 params.callback = callback;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1788
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1789 context->InvokeService(context, _OrthancPluginService_RegisterOnStoredInstanceCallback, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1790 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1791
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1792
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1793
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1794 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1795 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1796 OrthancPluginRestOutput* output;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1797 const char* answer;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1798 uint32_t answerSize;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1799 const char* mimeType;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1800 } _OrthancPluginAnswerBuffer;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1801
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1802 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1803 * @brief Answer to a REST request.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1804 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1805 * This function answers to a REST request with the content of a memory buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1806 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1807 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1808 * @param output The HTTP connection to the client application.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1809 * @param answer Pointer to the memory buffer containing the answer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1810 * @param answerSize Number of bytes of the answer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1811 * @param mimeType The MIME type of the answer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1812 * @ingroup REST
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1813 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1814 ORTHANC_PLUGIN_INLINE void OrthancPluginAnswerBuffer(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1815 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1816 OrthancPluginRestOutput* output,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1817 const char* answer,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1818 uint32_t answerSize,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1819 const char* mimeType)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1820 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1821 _OrthancPluginAnswerBuffer params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1822 params.output = output;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1823 params.answer = answer;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1824 params.answerSize = answerSize;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1825 params.mimeType = mimeType;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1826 context->InvokeService(context, _OrthancPluginService_AnswerBuffer, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1827 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1828
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1829
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1830 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1831 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1832 OrthancPluginRestOutput* output;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1833 OrthancPluginPixelFormat format;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1834 uint32_t width;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1835 uint32_t height;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1836 uint32_t pitch;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1837 const void* buffer;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1838 } _OrthancPluginCompressAndAnswerPngImage;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1839
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1840 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1841 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1842 OrthancPluginRestOutput* output;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1843 OrthancPluginImageFormat imageFormat;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1844 OrthancPluginPixelFormat pixelFormat;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1845 uint32_t width;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1846 uint32_t height;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1847 uint32_t pitch;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1848 const void* buffer;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1849 uint8_t quality;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1850 } _OrthancPluginCompressAndAnswerImage;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1851
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1852
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1853 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1854 * @brief Answer to a REST request with a PNG image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1855 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1856 * This function answers to a REST request with a PNG image. The
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1857 * parameters of this function describe a memory buffer that
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1858 * contains an uncompressed image. The image will be automatically compressed
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1859 * as a PNG image by the core system of Orthanc.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1860 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1861 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1862 * @param output The HTTP connection to the client application.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1863 * @param format The memory layout of the uncompressed image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1864 * @param width The width of the image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1865 * @param height The height of the image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1866 * @param pitch The pitch of the image (i.e. the number of bytes
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1867 * between 2 successive lines of the image in the memory buffer).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1868 * @param buffer The memory buffer containing the uncompressed image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1869 * @ingroup REST
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1870 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1871 ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerPngImage(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1872 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1873 OrthancPluginRestOutput* output,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1874 OrthancPluginPixelFormat format,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1875 uint32_t width,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1876 uint32_t height,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1877 uint32_t pitch,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1878 const void* buffer)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1879 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1880 _OrthancPluginCompressAndAnswerImage params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1881 params.output = output;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1882 params.imageFormat = OrthancPluginImageFormat_Png;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1883 params.pixelFormat = format;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1884 params.width = width;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1885 params.height = height;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1886 params.pitch = pitch;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1887 params.buffer = buffer;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1888 params.quality = 0; /* No quality for PNG */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1889 context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1890 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1891
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1892
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1893
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1894 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1895 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1896 OrthancPluginMemoryBuffer* target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1897 const char* instanceId;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1898 } _OrthancPluginGetDicomForInstance;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1899
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1900 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1901 * @brief Retrieve a DICOM instance using its Orthanc identifier.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1902 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1903 * Retrieve a DICOM instance using its Orthanc identifier. The DICOM
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1904 * file is stored into a newly allocated memory buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1905 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1906 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1907 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1908 * @param instanceId The Orthanc identifier of the DICOM instance of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1909 * @return 0 if success, or the error code if failure.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1910 * @ingroup Orthanc
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1911 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1912 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginGetDicomForInstance(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1913 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1914 OrthancPluginMemoryBuffer* target,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1915 const char* instanceId)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1916 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1917 _OrthancPluginGetDicomForInstance params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1918 params.target = target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1919 params.instanceId = instanceId;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1920 return context->InvokeService(context, _OrthancPluginService_GetDicomForInstance, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1921 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1922
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1923
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1924
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1925 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1926 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1927 OrthancPluginMemoryBuffer* target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1928 const char* uri;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1929 } _OrthancPluginRestApiGet;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1930
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1931 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1932 * @brief Make a GET call to the built-in Orthanc REST API.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1933 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1934 * Make a GET call to the built-in Orthanc REST API. The result to
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1935 * the query is stored into a newly allocated memory buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1936 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1937 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1938 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1939 * @param uri The URI in the built-in Orthanc API.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1940 * @return 0 if success, or the error code if failure.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1941 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1942 * @see OrthancPluginRestApiGetAfterPlugins
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1943 * @ingroup Orthanc
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1944 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1945 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGet(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1946 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1947 OrthancPluginMemoryBuffer* target,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1948 const char* uri)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1949 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1950 _OrthancPluginRestApiGet params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1951 params.target = target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1952 params.uri = uri;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1953 return context->InvokeService(context, _OrthancPluginService_RestApiGet, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1954 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1955
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1956
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1957
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1958 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1959 * @brief Make a GET call to the REST API, as tainted by the plugins.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1960 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1961 * Make a GET call to the Orthanc REST API, after all the plugins
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1962 * are applied. In other words, if some plugin overrides or adds the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1963 * called URI to the built-in Orthanc REST API, this call will
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1964 * return the result provided by this plugin. The result to the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1965 * query is stored into a newly allocated memory buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1966 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1967 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1968 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1969 * @param uri The URI in the built-in Orthanc API.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1970 * @return 0 if success, or the error code if failure.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1971 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1972 * @see OrthancPluginRestApiGet
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1973 * @ingroup Orthanc
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1974 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1975 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGetAfterPlugins(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1976 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1977 OrthancPluginMemoryBuffer* target,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1978 const char* uri)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1979 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1980 _OrthancPluginRestApiGet params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1981 params.target = target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1982 params.uri = uri;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1983 return context->InvokeService(context, _OrthancPluginService_RestApiGetAfterPlugins, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1984 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1985
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1986
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1987
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1988 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1989 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1990 OrthancPluginMemoryBuffer* target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1991 const char* uri;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1992 const char* body;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1993 uint32_t bodySize;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1994 } _OrthancPluginRestApiPostPut;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1995
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1996 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1997 * @brief Make a POST call to the built-in Orthanc REST API.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1998 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1999 * Make a POST call to the built-in Orthanc REST API. The result to
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2000 * the query is stored into a newly allocated memory buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2001 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2002 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2003 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2004 * @param uri The URI in the built-in Orthanc API.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2005 * @param body The body of the POST request.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2006 * @param bodySize The size of the body.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2007 * @return 0 if success, or the error code if failure.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2008 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2009 * @see OrthancPluginRestApiPostAfterPlugins
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2010 * @ingroup Orthanc
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2011 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2012 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPost(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2013 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2014 OrthancPluginMemoryBuffer* target,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2015 const char* uri,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2016 const char* body,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2017 uint32_t bodySize)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2018 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2019 _OrthancPluginRestApiPostPut params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2020 params.target = target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2021 params.uri = uri;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2022 params.body = body;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2023 params.bodySize = bodySize;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2024 return context->InvokeService(context, _OrthancPluginService_RestApiPost, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2025 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2026
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2027
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2028 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2029 * @brief Make a POST call to the REST API, as tainted by the plugins.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2030 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2031 * Make a POST call to the Orthanc REST API, after all the plugins
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2032 * are applied. In other words, if some plugin overrides or adds the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2033 * called URI to the built-in Orthanc REST API, this call will
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2034 * return the result provided by this plugin. The result to the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2035 * query is stored into a newly allocated memory buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2036 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2037 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2038 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2039 * @param uri The URI in the built-in Orthanc API.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2040 * @param body The body of the POST request.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2041 * @param bodySize The size of the body.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2042 * @return 0 if success, or the error code if failure.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2043 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2044 * @see OrthancPluginRestApiPost
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2045 * @ingroup Orthanc
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2046 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2047 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPostAfterPlugins(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2048 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2049 OrthancPluginMemoryBuffer* target,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2050 const char* uri,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2051 const char* body,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2052 uint32_t bodySize)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2053 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2054 _OrthancPluginRestApiPostPut params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2055 params.target = target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2056 params.uri = uri;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2057 params.body = body;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2058 params.bodySize = bodySize;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2059 return context->InvokeService(context, _OrthancPluginService_RestApiPostAfterPlugins, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2060 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2061
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2062
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2063
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2064 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2065 * @brief Make a DELETE call to the built-in Orthanc REST API.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2066 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2067 * Make a DELETE call to the built-in Orthanc REST API.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2068 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2069 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2070 * @param uri The URI to delete in the built-in Orthanc API.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2071 * @return 0 if success, or the error code if failure.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2072 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2073 * @see OrthancPluginRestApiDeleteAfterPlugins
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2074 * @ingroup Orthanc
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2075 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2076 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiDelete(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2077 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2078 const char* uri)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2079 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2080 return context->InvokeService(context, _OrthancPluginService_RestApiDelete, uri);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2081 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2082
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2083
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2084 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2085 * @brief Make a DELETE call to the REST API, as tainted by the plugins.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2086 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2087 * Make a DELETE call to the Orthanc REST API, after all the plugins
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2088 * are applied. In other words, if some plugin overrides or adds the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2089 * called URI to the built-in Orthanc REST API, this call will
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2090 * return the result provided by this plugin.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2091 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2092 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2093 * @param uri The URI to delete in the built-in Orthanc API.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2094 * @return 0 if success, or the error code if failure.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2095 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2096 * @see OrthancPluginRestApiDelete
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2097 * @ingroup Orthanc
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2098 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2099 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiDeleteAfterPlugins(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2100 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2101 const char* uri)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2102 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2103 return context->InvokeService(context, _OrthancPluginService_RestApiDeleteAfterPlugins, uri);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2104 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2105
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2106
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2107
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2108 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2109 * @brief Make a PUT call to the built-in Orthanc REST API.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2110 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2111 * Make a PUT call to the built-in Orthanc REST API. The result to
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2112 * the query is stored into a newly allocated memory buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2113 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2114 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2115 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2116 * @param uri The URI in the built-in Orthanc API.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2117 * @param body The body of the PUT request.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2118 * @param bodySize The size of the body.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2119 * @return 0 if success, or the error code if failure.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2120 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2121 * @see OrthancPluginRestApiPutAfterPlugins
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2122 * @ingroup Orthanc
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2123 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2124 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPut(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2125 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2126 OrthancPluginMemoryBuffer* target,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2127 const char* uri,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2128 const char* body,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2129 uint32_t bodySize)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2130 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2131 _OrthancPluginRestApiPostPut params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2132 params.target = target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2133 params.uri = uri;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2134 params.body = body;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2135 params.bodySize = bodySize;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2136 return context->InvokeService(context, _OrthancPluginService_RestApiPut, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2137 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2138
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2139
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2140
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2141 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2142 * @brief Make a PUT call to the REST API, as tainted by the plugins.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2143 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2144 * Make a PUT call to the Orthanc REST API, after all the plugins
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2145 * are applied. In other words, if some plugin overrides or adds the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2146 * called URI to the built-in Orthanc REST API, this call will
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2147 * return the result provided by this plugin. The result to the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2148 * query is stored into a newly allocated memory buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2149 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2150 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2151 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2152 * @param uri The URI in the built-in Orthanc API.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2153 * @param body The body of the PUT request.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2154 * @param bodySize The size of the body.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2155 * @return 0 if success, or the error code if failure.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
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.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2157 * @see OrthancPluginRestApiPut
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2158 * @ingroup Orthanc
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2159 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2160 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPutAfterPlugins(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2161 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2162 OrthancPluginMemoryBuffer* target,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2163 const char* uri,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2164 const char* body,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2165 uint32_t bodySize)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2166 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2167 _OrthancPluginRestApiPostPut params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2168 params.target = target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2169 params.uri = uri;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2170 params.body = body;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2171 params.bodySize = bodySize;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2172 return context->InvokeService(context, _OrthancPluginService_RestApiPutAfterPlugins, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2173 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2174
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2175
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2176
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2177 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2178 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2179 OrthancPluginRestOutput* output;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2180 const char* argument;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2181 } _OrthancPluginOutputPlusArgument;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2182
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2183 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2184 * @brief Redirect a REST request.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2185 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2186 * This function answers to a REST request by redirecting the user
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2187 * to another URI using HTTP status 301.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2188 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2189 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2190 * @param output The HTTP connection to the client application.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2191 * @param redirection Where to redirect.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2192 * @ingroup REST
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2193 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2194 ORTHANC_PLUGIN_INLINE void OrthancPluginRedirect(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2195 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2196 OrthancPluginRestOutput* output,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2197 const char* redirection)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2198 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2199 _OrthancPluginOutputPlusArgument params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2200 params.output = output;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2201 params.argument = redirection;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2202 context->InvokeService(context, _OrthancPluginService_Redirect, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2203 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2204
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2205
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2206
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2207 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2208 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2209 char** result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2210 const char* argument;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2211 } _OrthancPluginRetrieveDynamicString;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2212
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2213 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2214 * @brief Look for a patient.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2215 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2216 * Look for a patient stored in Orthanc, using its Patient ID tag (0x0010, 0x0020).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2217 * This function uses the database index to run as fast as possible (it does not loop
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2218 * over all the stored patients).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2219 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2220 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2221 * @param patientID The Patient ID of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2222 * @return The NULL value if the patient is non-existent, or a string containing the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2223 * Orthanc ID of the patient. This string must be freed by OrthancPluginFreeString().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2224 * @ingroup Orthanc
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2225 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2226 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupPatient(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2227 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2228 const char* patientID)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2229 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2230 char* result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2231
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2232 _OrthancPluginRetrieveDynamicString params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2233 params.result = &result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2234 params.argument = patientID;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2235
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2236 if (context->InvokeService(context, _OrthancPluginService_LookupPatient, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2237 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2238 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2239 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2240 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2241 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2242 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2243 return result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2244 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2245 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2246
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2247
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2248 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2249 * @brief Look for a study.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2250 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2251 * Look for a study stored in Orthanc, using its Study Instance UID tag (0x0020, 0x000d).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2252 * This function uses the database index to run as fast as possible (it does not loop
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2253 * over all the stored studies).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2254 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2255 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2256 * @param studyUID The Study Instance UID of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2257 * @return The NULL value if the study is non-existent, or a string containing the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2258 * Orthanc ID of the study. This string must be freed by OrthancPluginFreeString().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2259 * @ingroup Orthanc
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2260 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2261 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudy(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2262 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2263 const char* studyUID)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2264 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2265 char* result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2266
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2267 _OrthancPluginRetrieveDynamicString params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2268 params.result = &result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2269 params.argument = studyUID;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2270
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2271 if (context->InvokeService(context, _OrthancPluginService_LookupStudy, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2272 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2273 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2274 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2275 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2276 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2277 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2278 return result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2279 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2280 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2281
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2282
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2283 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2284 * @brief Look for a study, using the accession number.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2285 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2286 * Look for a study stored in Orthanc, using its Accession Number tag (0x0008, 0x0050).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2287 * This function uses the database index to run as fast as possible (it does not loop
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2288 * over all the stored studies).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2289 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2290 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2291 * @param accessionNumber The Accession Number of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2292 * @return The NULL value if the study is non-existent, or a string containing the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2293 * Orthanc ID of the study. This string must be freed by OrthancPluginFreeString().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2294 * @ingroup Orthanc
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2295 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2296 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudyWithAccessionNumber(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2297 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2298 const char* accessionNumber)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2299 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2300 char* result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2301
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2302 _OrthancPluginRetrieveDynamicString params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2303 params.result = &result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2304 params.argument = accessionNumber;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2305
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2306 if (context->InvokeService(context, _OrthancPluginService_LookupStudyWithAccessionNumber, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2307 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2308 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2309 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2310 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2311 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2312 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2313 return result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2314 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2315 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2316
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2317
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2318 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2319 * @brief Look for a series.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2320 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2321 * Look for a series stored in Orthanc, using its Series Instance UID tag (0x0020, 0x000e).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2322 * This function uses the database index to run as fast as possible (it does not loop
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2323 * over all the stored series).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2324 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2325 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2326 * @param seriesUID The Series Instance UID of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2327 * @return The NULL value if the series is non-existent, or a string containing the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2328 * Orthanc ID of the series. This string must be freed by OrthancPluginFreeString().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2329 * @ingroup Orthanc
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2330 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2331 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupSeries(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2332 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2333 const char* seriesUID)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2334 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2335 char* result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2336
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2337 _OrthancPluginRetrieveDynamicString params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2338 params.result = &result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2339 params.argument = seriesUID;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2340
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2341 if (context->InvokeService(context, _OrthancPluginService_LookupSeries, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2342 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2343 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2344 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2345 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2346 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2347 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2348 return result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2349 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2350 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2351
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2352
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2353 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2354 * @brief Look for an instance.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2355 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2356 * Look for an instance stored in Orthanc, using its SOP Instance UID tag (0x0008, 0x0018).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2357 * This function uses the database index to run as fast as possible (it does not loop
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2358 * over all the stored instances).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2359 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2360 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2361 * @param sopInstanceUID The SOP Instance UID of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2362 * @return The NULL value if the instance is non-existent, or a string containing the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2363 * Orthanc ID of the instance. This string must be freed by OrthancPluginFreeString().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2364 * @ingroup Orthanc
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2365 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2366 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupInstance(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2367 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2368 const char* sopInstanceUID)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2369 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2370 char* result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2371
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2372 _OrthancPluginRetrieveDynamicString params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2373 params.result = &result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2374 params.argument = sopInstanceUID;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2375
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2376 if (context->InvokeService(context, _OrthancPluginService_LookupInstance, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2377 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2378 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2379 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2380 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2381 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2382 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2383 return result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2384 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2385 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2386
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2387
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2388
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2389 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2390 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2391 OrthancPluginRestOutput* output;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2392 uint16_t status;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2393 } _OrthancPluginSendHttpStatusCode;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2394
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2395 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2396 * @brief Send a HTTP status code.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2397 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2398 * This function answers to a REST request by sending a HTTP status
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2399 * code (such as "400 - Bad Request"). Note that:
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2400 * - Successful requests (status 200) must use ::OrthancPluginAnswerBuffer().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2401 * - Redirections (status 301) must use ::OrthancPluginRedirect().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2402 * - Unauthorized access (status 401) must use ::OrthancPluginSendUnauthorized().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2403 * - Methods not allowed (status 405) must use ::OrthancPluginSendMethodNotAllowed().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2404 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2405 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2406 * @param output The HTTP connection to the client application.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2407 * @param status The HTTP status code to be sent.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2408 * @ingroup REST
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2409 * @see OrthancPluginSendHttpStatus()
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2410 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2411 ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatusCode(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2412 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2413 OrthancPluginRestOutput* output,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2414 uint16_t status)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2415 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2416 _OrthancPluginSendHttpStatusCode params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2417 params.output = output;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2418 params.status = status;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2419 context->InvokeService(context, _OrthancPluginService_SendHttpStatusCode, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2420 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2421
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2422
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2423 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2424 * @brief Signal that a REST request is not authorized.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2425 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2426 * This function answers to a REST request by signaling that it is
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2427 * not authorized.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2428 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2429 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2430 * @param output The HTTP connection to the client application.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2431 * @param realm The realm for the authorization process.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2432 * @ingroup REST
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2433 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2434 ORTHANC_PLUGIN_INLINE void OrthancPluginSendUnauthorized(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2435 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2436 OrthancPluginRestOutput* output,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2437 const char* realm)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2438 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2439 _OrthancPluginOutputPlusArgument params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2440 params.output = output;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2441 params.argument = realm;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2442 context->InvokeService(context, _OrthancPluginService_SendUnauthorized, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2443 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2444
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2445
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2446 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2447 * @brief Signal that this URI does not support this HTTP method.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2448 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2449 * This function answers to a REST request by signaling that the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2450 * queried URI does not support this method.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2451 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2452 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2453 * @param output The HTTP connection to the client application.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2454 * @param allowedMethods The allowed methods for this URI (e.g. "GET,POST" after a PUT or a POST request).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2455 * @ingroup REST
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2456 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2457 ORTHANC_PLUGIN_INLINE void OrthancPluginSendMethodNotAllowed(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2458 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2459 OrthancPluginRestOutput* output,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2460 const char* allowedMethods)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2461 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2462 _OrthancPluginOutputPlusArgument params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2463 params.output = output;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2464 params.argument = allowedMethods;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2465 context->InvokeService(context, _OrthancPluginService_SendMethodNotAllowed, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2466 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2467
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2468
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2469 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2470 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2471 OrthancPluginRestOutput* output;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2472 const char* key;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2473 const char* value;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2474 } _OrthancPluginSetHttpHeader;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2475
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2476 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2477 * @brief Set a cookie.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2478 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2479 * This function sets a cookie in the HTTP client.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2480 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2481 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2482 * @param output The HTTP connection to the client application.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2483 * @param cookie The cookie to be set.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2484 * @param value The value of the cookie.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2485 * @ingroup REST
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2486 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2487 ORTHANC_PLUGIN_INLINE void OrthancPluginSetCookie(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2488 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2489 OrthancPluginRestOutput* output,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2490 const char* cookie,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2491 const char* value)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2492 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2493 _OrthancPluginSetHttpHeader params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2494 params.output = output;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2495 params.key = cookie;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2496 params.value = value;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2497 context->InvokeService(context, _OrthancPluginService_SetCookie, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2498 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2499
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2500
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2501 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2502 * @brief Set some HTTP header.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2503 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2504 * This function sets a HTTP header in the HTTP answer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2505 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2506 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2507 * @param output The HTTP connection to the client application.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2508 * @param key The HTTP header to be set.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2509 * @param value The value of the HTTP header.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2510 * @ingroup REST
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2511 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2512 ORTHANC_PLUGIN_INLINE void OrthancPluginSetHttpHeader(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2513 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2514 OrthancPluginRestOutput* output,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2515 const char* key,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2516 const char* value)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2517 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2518 _OrthancPluginSetHttpHeader params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2519 params.output = output;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2520 params.key = key;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2521 params.value = value;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2522 context->InvokeService(context, _OrthancPluginService_SetHttpHeader, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2523 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2524
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2525
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2526 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2527 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2528 char** resultStringToFree;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2529 const char** resultString;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2530 int64_t* resultInt64;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2531 const char* key;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2532 OrthancPluginDicomInstance* instance;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2533 OrthancPluginInstanceOrigin* resultOrigin; /* New in Orthanc 0.9.5 SDK */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2534 } _OrthancPluginAccessDicomInstance;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2535
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2536
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2537 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2538 * @brief Get the AET of a DICOM instance.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2539 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2540 * This function returns the Application Entity Title (AET) of the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2541 * DICOM modality from which a DICOM instance originates.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2542 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2543 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2544 * @param instance The instance of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2545 * @return The AET if success, NULL if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2546 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2547 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2548 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceRemoteAet(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2549 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2550 OrthancPluginDicomInstance* instance)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2551 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2552 const char* result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2553
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2554 _OrthancPluginAccessDicomInstance params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2555 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2556 params.resultString = &result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2557 params.instance = instance;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2558
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2559 if (context->InvokeService(context, _OrthancPluginService_GetInstanceRemoteAet, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2560 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2561 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2562 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2563 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2564 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2565 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2566 return result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2567 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2568 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2569
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2570
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2571 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2572 * @brief Get the size of a DICOM file.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2573 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2574 * This function returns the number of bytes of the given DICOM instance.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2575 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2576 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2577 * @param instance The instance of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2578 * @return The size of the file, -1 in case of error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2579 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2580 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2581 ORTHANC_PLUGIN_INLINE int64_t OrthancPluginGetInstanceSize(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2582 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2583 OrthancPluginDicomInstance* instance)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2584 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2585 int64_t size;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2586
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2587 _OrthancPluginAccessDicomInstance params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2588 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2589 params.resultInt64 = &size;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2590 params.instance = instance;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2591
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2592 if (context->InvokeService(context, _OrthancPluginService_GetInstanceSize, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2593 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2594 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2595 return -1;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2596 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2597 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2598 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2599 return size;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2600 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2601 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2602
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2603
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2604 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2605 * @brief Get the data of a DICOM file.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2606 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2607 * This function returns a pointer to the content of the given DICOM instance.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2608 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2609 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2610 * @param instance The instance of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2611 * @return The pointer to the DICOM data, NULL in case of error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2612 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2613 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2614 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceData(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2615 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2616 OrthancPluginDicomInstance* instance)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2617 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2618 const char* result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2619
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2620 _OrthancPluginAccessDicomInstance params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2621 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2622 params.resultString = &result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2623 params.instance = instance;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2624
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2625 if (context->InvokeService(context, _OrthancPluginService_GetInstanceData, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2626 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2627 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2628 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2629 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2630 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2631 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2632 return result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2633 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2634 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2635
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2636
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2637 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2638 * @brief Get the DICOM tag hierarchy as a JSON file.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2639 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2640 * This function returns a pointer to a newly created string
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2641 * containing a JSON file. This JSON file encodes the tag hierarchy
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2642 * of the given DICOM instance.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2643 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2644 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2645 * @param instance The instance of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2646 * @return The NULL value in case of error, or a string containing the JSON file.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2647 * This string must be freed by OrthancPluginFreeString().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2648 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2649 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2650 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceJson(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2651 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2652 OrthancPluginDicomInstance* instance)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2653 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2654 char* result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2655
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2656 _OrthancPluginAccessDicomInstance params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2657 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2658 params.resultStringToFree = &result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2659 params.instance = instance;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2660
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2661 if (context->InvokeService(context, _OrthancPluginService_GetInstanceJson, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2662 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2663 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2664 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2665 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2666 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2667 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2668 return result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2669 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2670 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2671
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2672
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2673 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2674 * @brief Get the DICOM tag hierarchy as a JSON file (with simplification).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2675 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2676 * This function returns a pointer to a newly created string
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2677 * containing a JSON file. This JSON file encodes the tag hierarchy
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2678 * of the given DICOM instance. In contrast with
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2679 * ::OrthancPluginGetInstanceJson(), the returned JSON file is in
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2680 * its simplified version.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2681 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2682 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2683 * @param instance The instance of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2684 * @return The NULL value in case of error, or a string containing the JSON file.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2685 * This string must be freed by OrthancPluginFreeString().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2686 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2687 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2688 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceSimplifiedJson(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2689 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2690 OrthancPluginDicomInstance* instance)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2691 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2692 char* result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2693
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2694 _OrthancPluginAccessDicomInstance params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2695 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2696 params.resultStringToFree = &result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2697 params.instance = instance;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2698
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2699 if (context->InvokeService(context, _OrthancPluginService_GetInstanceSimplifiedJson, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2700 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2701 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2702 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2703 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2704 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2705 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2706 return result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2707 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2708 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2709
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2710
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2711 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2712 * @brief Check whether a DICOM instance is associated with some metadata.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2713 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2714 * This function checks whether the DICOM instance of interest is
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2715 * associated with some metadata. As of Orthanc 0.8.1, in the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2716 * callbacks registered by
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2717 * ::OrthancPluginRegisterOnStoredInstanceCallback(), the only
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2718 * possibly available metadata are "ReceptionDate", "RemoteAET" and
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2719 * "IndexInSeries".
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2720 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2721 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2722 * @param instance The instance of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2723 * @param metadata The metadata of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2724 * @return 1 if the metadata is present, 0 if it is absent, -1 in case of error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2725 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2726 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2727 ORTHANC_PLUGIN_INLINE int OrthancPluginHasInstanceMetadata(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2728 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2729 OrthancPluginDicomInstance* instance,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2730 const char* metadata)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2731 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2732 int64_t result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2733
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2734 _OrthancPluginAccessDicomInstance params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2735 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2736 params.resultInt64 = &result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2737 params.instance = instance;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2738 params.key = metadata;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2739
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2740 if (context->InvokeService(context, _OrthancPluginService_HasInstanceMetadata, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2741 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2742 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2743 return -1;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2744 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2745 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2746 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2747 return (result != 0);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2748 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2749 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2750
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2751
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2752 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2753 * @brief Get the value of some metadata associated with a given DICOM instance.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2754 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2755 * This functions returns the value of some metadata that is associated with the DICOM instance of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2756 * Before calling this function, the existence of the metadata must have been checked with
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2757 * ::OrthancPluginHasInstanceMetadata().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2758 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2759 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2760 * @param instance The instance of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2761 * @param metadata The metadata of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2762 * @return The metadata value if success, NULL if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2763 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2764 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2765 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceMetadata(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2766 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2767 OrthancPluginDicomInstance* instance,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2768 const char* metadata)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2769 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2770 const char* result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2771
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2772 _OrthancPluginAccessDicomInstance params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2773 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2774 params.resultString = &result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2775 params.instance = instance;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2776 params.key = metadata;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2777
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2778 if (context->InvokeService(context, _OrthancPluginService_GetInstanceMetadata, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2779 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2780 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2781 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2782 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2783 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2784 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2785 return result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2786 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2787 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2788
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2789
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2790
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2791 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2792 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2793 OrthancPluginStorageCreate create;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2794 OrthancPluginStorageRead read;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2795 OrthancPluginStorageRemove remove;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2796 OrthancPluginFree free;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2797 } _OrthancPluginRegisterStorageArea;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2798
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2799 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2800 * @brief Register a custom storage area.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2801 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2802 * This function registers a custom storage area, to replace the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2803 * built-in way Orthanc stores its files on the filesystem. This
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2804 * function must be called during the initialization of the plugin,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2805 * i.e. inside the OrthancPluginInitialize() public function.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2806 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2807 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2808 * @param create The callback function to store a file on the custom storage area.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2809 * @param read The callback function to read a file from the custom storage area.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2810 * @param remove The callback function to remove a file from the custom storage area.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2811 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2812 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2813 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterStorageArea(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2814 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2815 OrthancPluginStorageCreate create,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2816 OrthancPluginStorageRead read,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2817 OrthancPluginStorageRemove remove)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2818 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2819 _OrthancPluginRegisterStorageArea params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2820 params.create = create;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2821 params.read = read;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2822 params.remove = remove;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2823
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2824 #ifdef __cplusplus
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2825 params.free = ::free;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2826 #else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2827 params.free = free;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2828 #endif
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2829
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2830 context->InvokeService(context, _OrthancPluginService_RegisterStorageArea, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2831 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2832
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2833
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2834
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2835 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2836 * @brief Return the path to the Orthanc executable.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2837 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2838 * This function returns the path to the Orthanc executable.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2839 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2840 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2841 * @return NULL in the case of an error, or a newly allocated string
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2842 * containing the path. This string must be freed by
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2843 * OrthancPluginFreeString().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2844 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2845 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancPath(OrthancPluginContext* context)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2846 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2847 char* result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2848
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2849 _OrthancPluginRetrieveDynamicString params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2850 params.result = &result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2851 params.argument = NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2852
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2853 if (context->InvokeService(context, _OrthancPluginService_GetOrthancPath, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2854 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2855 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2856 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2857 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2858 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2859 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2860 return result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2861 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2862 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2863
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2864
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2865 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2866 * @brief Return the directory containing the Orthanc.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2867 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2868 * This function returns the path to the directory containing the Orthanc executable.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2869 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2870 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2871 * @return NULL in the case of an error, or a newly allocated string
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2872 * containing the path. This string must be freed by
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2873 * OrthancPluginFreeString().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2874 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2875 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancDirectory(OrthancPluginContext* context)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2876 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2877 char* result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2878
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2879 _OrthancPluginRetrieveDynamicString params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2880 params.result = &result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2881 params.argument = NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2882
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2883 if (context->InvokeService(context, _OrthancPluginService_GetOrthancDirectory, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2884 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2885 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2886 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2887 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2888 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2889 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2890 return result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2891 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2892 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2893
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2894
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2895 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2896 * @brief Return the path to the configuration file(s).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2897 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2898 * This function returns the path to the configuration file(s) that
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2899 * was specified when starting Orthanc. Since version 0.9.1, this
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2900 * path can refer to a folder that stores a set of configuration
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2901 * files. This function is deprecated in favor of
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2902 * OrthancPluginGetConfiguration().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2903 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2904 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2905 * @return NULL in the case of an error, or a newly allocated string
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2906 * containing the path. This string must be freed by
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2907 * OrthancPluginFreeString().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2908 * @see OrthancPluginGetConfiguration()
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2909 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2910 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfigurationPath(OrthancPluginContext* context)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2911 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2912 char* result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2913
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2914 _OrthancPluginRetrieveDynamicString params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2915 params.result = &result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2916 params.argument = NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2917
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2918 if (context->InvokeService(context, _OrthancPluginService_GetConfigurationPath, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2919 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2920 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2921 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2922 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2923 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2924 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2925 return result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2926 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2927 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2928
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2929
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2930
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2931 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2932 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2933 OrthancPluginOnChangeCallback callback;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2934 } _OrthancPluginOnChangeCallback;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2935
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2936 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2937 * @brief Register a callback to monitor changes.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2938 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2939 * This function registers a callback function that is called
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2940 * whenever a change happens to some DICOM resource.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2941 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2942 * @warning If your change callback has to call the REST API of
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2943 * Orthanc, you should make these calls in a separate thread (with
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2944 * the events passing through a message queue). Otherwise, this
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2945 * could result in deadlocks in the presence of other plugins or Lua
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2946 * scripts.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2947 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2948 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2949 * @param callback The callback function.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2950 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2951 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2952 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnChangeCallback(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2953 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2954 OrthancPluginOnChangeCallback callback)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2955 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2956 _OrthancPluginOnChangeCallback params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2957 params.callback = callback;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2958
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2959 context->InvokeService(context, _OrthancPluginService_RegisterOnChangeCallback, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2960 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2961
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2962
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2963
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2964 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2965 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2966 const char* plugin;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2967 _OrthancPluginProperty property;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2968 const char* value;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2969 } _OrthancPluginSetPluginProperty;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2970
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2971
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2972 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2973 * @brief Set the URI where the plugin provides its Web interface.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2974 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2975 * For plugins that come with a Web interface, this function
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2976 * declares the entry path where to find this interface. This
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2977 * information is notably used in the "Plugins" page of Orthanc
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2978 * Explorer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2979 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2980 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2981 * @param uri The root URI for this plugin.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2982 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2983 ORTHANC_PLUGIN_INLINE void OrthancPluginSetRootUri(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2984 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2985 const char* uri)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2986 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2987 _OrthancPluginSetPluginProperty params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2988 params.plugin = OrthancPluginGetName();
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2989 params.property = _OrthancPluginProperty_RootUri;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2990 params.value = uri;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2991
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2992 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2993 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2994
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2995
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2996 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2997 * @brief Set a description for this plugin.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2998 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2999 * Set a description for this plugin. It is displayed in the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3000 * "Plugins" page of Orthanc Explorer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3001 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3002 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3003 * @param description The description.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3004 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3005 ORTHANC_PLUGIN_INLINE void OrthancPluginSetDescription(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3006 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3007 const char* description)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3008 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3009 _OrthancPluginSetPluginProperty params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3010 params.plugin = OrthancPluginGetName();
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3011 params.property = _OrthancPluginProperty_Description;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3012 params.value = description;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3013
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3014 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3015 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3016
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3017
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3018 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3019 * @brief Extend the JavaScript code of Orthanc Explorer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3020 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3021 * Add JavaScript code to customize the default behavior of Orthanc
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3022 * Explorer. This can for instance be used to add new buttons.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3023 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3024 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3025 * @param javascript The custom JavaScript code.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3026 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3027 ORTHANC_PLUGIN_INLINE void OrthancPluginExtendOrthancExplorer(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3028 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3029 const char* javascript)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3030 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3031 _OrthancPluginSetPluginProperty params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3032 params.plugin = OrthancPluginGetName();
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3033 params.property = _OrthancPluginProperty_OrthancExplorer;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3034 params.value = javascript;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3035
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3036 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3037 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3038
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3039
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3040 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3041 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3042 char** result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3043 int32_t property;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3044 const char* value;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3045 } _OrthancPluginGlobalProperty;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3046
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3047
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3048 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3049 * @brief Get the value of a global property.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3050 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3051 * Get the value of a global property that is stored in the Orthanc database. Global
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3052 * properties whose index is below 1024 are reserved by Orthanc.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3053 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3054 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3055 * @param property The global property of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3056 * @param defaultValue The value to return, if the global property is unset.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3057 * @return The value of the global property, or NULL in the case of an error. This
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3058 * string must be freed by OrthancPluginFreeString().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3059 * @ingroup Orthanc
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3060 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3061 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetGlobalProperty(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3062 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3063 int32_t property,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3064 const char* defaultValue)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3065 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3066 char* result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3067
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3068 _OrthancPluginGlobalProperty params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3069 params.result = &result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3070 params.property = property;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3071 params.value = defaultValue;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3072
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3073 if (context->InvokeService(context, _OrthancPluginService_GetGlobalProperty, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3074 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3075 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3076 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3077 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3078 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3079 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3080 return result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3081 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3082 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3083
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3084
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3085 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3086 * @brief Set the value of a global property.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3087 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3088 * Set the value of a global property into the Orthanc
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3089 * database. Setting a global property can be used by plugins to
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3090 * save their internal parameters. Plugins are only allowed to set
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3091 * properties whose index are above or equal to 1024 (properties
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3092 * below 1024 are read-only and reserved by Orthanc).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3093 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3094 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3095 * @param property The global property of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3096 * @param value The value to be set in the global property.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3097 * @return 0 if success, or the error code if failure.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3098 * @ingroup Orthanc
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3099 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3100 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSetGlobalProperty(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3101 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3102 int32_t property,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3103 const char* value)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3104 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3105 _OrthancPluginGlobalProperty params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3106 params.result = NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3107 params.property = property;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3108 params.value = value;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3109
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3110 return context->InvokeService(context, _OrthancPluginService_SetGlobalProperty, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3111 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3112
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3113
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3114
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3115 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3116 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3117 int32_t *resultInt32;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3118 uint32_t *resultUint32;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3119 int64_t *resultInt64;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3120 uint64_t *resultUint64;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3121 } _OrthancPluginReturnSingleValue;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3122
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3123 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3124 * @brief Get the number of command-line arguments.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3125 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3126 * Retrieve the number of command-line arguments that were used to launch Orthanc.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3127 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3128 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3129 * @return The number of arguments.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3130 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3131 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetCommandLineArgumentsCount(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3132 OrthancPluginContext* context)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3133 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3134 uint32_t count = 0;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3135
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3136 _OrthancPluginReturnSingleValue params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3137 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3138 params.resultUint32 = &count;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3139
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3140 if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgumentsCount, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3141 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3142 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3143 return 0;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3144 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3145 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3146 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3147 return count;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3148 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3149 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3150
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3151
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3152
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3153 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3154 * @brief Get the value of a command-line argument.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3155 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3156 * Get the value of one of the command-line arguments that were used
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3157 * to launch Orthanc. The number of available arguments can be
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3158 * retrieved by OrthancPluginGetCommandLineArgumentsCount().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3159 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3160 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3161 * @param argument The index of the argument.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3162 * @return The value of the argument, or NULL in the case of an error. This
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3163 * string must be freed by OrthancPluginFreeString().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3164 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3165 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetCommandLineArgument(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3166 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3167 uint32_t argument)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3168 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3169 char* result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3170
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3171 _OrthancPluginGlobalProperty params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3172 params.result = &result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3173 params.property = (int32_t) argument;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3174 params.value = NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3175
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3176 if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgument, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3177 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3178 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3179 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3180 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3181 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3182 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3183 return result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3184 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3185 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3186
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3187
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3188 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3189 * @brief Get the expected version of the database schema.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3190 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3191 * Retrieve the expected version of the database schema.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3192 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3193 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3194 * @return The version.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3195 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3196 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3197 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetExpectedDatabaseVersion(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3198 OrthancPluginContext* context)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3199 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3200 uint32_t count = 0;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3201
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3202 _OrthancPluginReturnSingleValue params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3203 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3204 params.resultUint32 = &count;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3205
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3206 if (context->InvokeService(context, _OrthancPluginService_GetExpectedDatabaseVersion, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3207 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3208 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3209 return 0;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3210 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3211 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3212 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3213 return count;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3214 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3215 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3216
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3217
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3218
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3219 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3220 * @brief Return the content of the configuration file(s).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3221 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3222 * This function returns the content of the configuration that is
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3223 * used by Orthanc, formatted as a JSON string.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3224 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3225 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3226 * @return NULL in the case of an error, or a newly allocated string
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3227 * containing the configuration. This string must be freed by
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3228 * OrthancPluginFreeString().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3229 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3230 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfiguration(OrthancPluginContext* context)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3231 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3232 char* result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3233
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3234 _OrthancPluginRetrieveDynamicString params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3235 params.result = &result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3236 params.argument = NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3237
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3238 if (context->InvokeService(context, _OrthancPluginService_GetConfiguration, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3239 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3240 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3241 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3242 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3243 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3244 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3245 return result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3246 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3247 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3248
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3249
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3250
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3251 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3252 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3253 OrthancPluginRestOutput* output;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3254 const char* subType;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3255 const char* contentType;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3256 } _OrthancPluginStartMultipartAnswer;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3257
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3258 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3259 * @brief Start an HTTP multipart answer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3260 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3261 * Initiates a HTTP multipart answer, as the result of a REST request.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3262 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3263 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3264 * @param output The HTTP connection to the client application.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3265 * @param subType The sub-type of the multipart answer ("mixed" or "related").
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3266 * @param contentType The MIME type of the items in the multipart answer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3267 * @return 0 if success, or the error code if failure.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3268 * @see OrthancPluginSendMultipartItem(), OrthancPluginSendMultipartItem2()
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3269 * @ingroup REST
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3270 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3271 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStartMultipartAnswer(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3272 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3273 OrthancPluginRestOutput* output,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3274 const char* subType,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3275 const char* contentType)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3276 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3277 _OrthancPluginStartMultipartAnswer params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3278 params.output = output;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3279 params.subType = subType;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3280 params.contentType = contentType;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3281 return context->InvokeService(context, _OrthancPluginService_StartMultipartAnswer, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3282 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3283
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3284
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3285 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3286 * @brief Send an item as a part of some HTTP multipart answer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3287 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3288 * This function sends an item as a part of some HTTP multipart
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3289 * answer that was initiated by OrthancPluginStartMultipartAnswer().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3290 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3291 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3292 * @param output The HTTP connection to the client application.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3293 * @param answer Pointer to the memory buffer containing the item.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3294 * @param answerSize Number of bytes of the item.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3295 * @return 0 if success, or the error code if failure (this notably happens
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3296 * if the connection is closed by the client).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3297 * @see OrthancPluginSendMultipartItem2()
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3298 * @ingroup REST
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3299 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3300 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSendMultipartItem(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3301 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3302 OrthancPluginRestOutput* output,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3303 const char* answer,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3304 uint32_t answerSize)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3305 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3306 _OrthancPluginAnswerBuffer params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3307 params.output = output;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3308 params.answer = answer;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3309 params.answerSize = answerSize;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3310 params.mimeType = NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3311 return context->InvokeService(context, _OrthancPluginService_SendMultipartItem, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3312 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3313
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3314
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3315
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3316 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3317 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3318 OrthancPluginMemoryBuffer* target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3319 const void* source;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3320 uint32_t size;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3321 OrthancPluginCompressionType compression;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3322 uint8_t uncompress;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3323 } _OrthancPluginBufferCompression;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3324
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3325
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3326 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3327 * @brief Compress or decompress a buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3328 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3329 * This function compresses or decompresses a buffer, using the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3330 * version of the zlib library that is used by the Orthanc core.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3331 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3332 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3333 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3334 * @param source The source buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3335 * @param size The size in bytes of the source buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3336 * @param compression The compression algorithm.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3337 * @param uncompress If set to "0", the buffer must be compressed.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3338 * If set to "1", the buffer must be uncompressed.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3339 * @return 0 if success, or the error code if failure.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3340 * @ingroup Images
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3341 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3342 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginBufferCompression(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3343 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3344 OrthancPluginMemoryBuffer* target,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3345 const void* source,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3346 uint32_t size,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3347 OrthancPluginCompressionType compression,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3348 uint8_t uncompress)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3349 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3350 _OrthancPluginBufferCompression params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3351 params.target = target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3352 params.source = source;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3353 params.size = size;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3354 params.compression = compression;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3355 params.uncompress = uncompress;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3356
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3357 return context->InvokeService(context, _OrthancPluginService_BufferCompression, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3358 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3359
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3360
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3361
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3362 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3363 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3364 OrthancPluginMemoryBuffer* target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3365 const char* path;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3366 } _OrthancPluginReadFile;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3367
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3368 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3369 * @brief Read a file.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3370 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3371 * Read the content of a file on the filesystem, and returns it into
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3372 * a newly allocated memory buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3373 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3374 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3375 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3376 * @param path The path of the file to be read.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3377 * @return 0 if success, or the error code if failure.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3378 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3379 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginReadFile(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3380 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3381 OrthancPluginMemoryBuffer* target,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3382 const char* path)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3383 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3384 _OrthancPluginReadFile params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3385 params.target = target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3386 params.path = path;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3387 return context->InvokeService(context, _OrthancPluginService_ReadFile, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3388 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3389
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3390
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3391
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3392 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3393 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3394 const char* path;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3395 const void* data;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3396 uint32_t size;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3397 } _OrthancPluginWriteFile;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3398
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3399 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3400 * @brief Write a file.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3401 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3402 * Write the content of a memory buffer to the filesystem.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3403 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3404 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3405 * @param path The path of the file to be written.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3406 * @param data The content of the memory buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3407 * @param size The size of the memory buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3408 * @return 0 if success, or the error code if failure.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3409 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3410 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWriteFile(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3411 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3412 const char* path,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3413 const void* data,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3414 uint32_t size)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3415 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3416 _OrthancPluginWriteFile params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3417 params.path = path;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3418 params.data = data;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3419 params.size = size;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3420 return context->InvokeService(context, _OrthancPluginService_WriteFile, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3421 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3422
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3423
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3424
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3425 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3426 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3427 const char** target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3428 OrthancPluginErrorCode error;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3429 } _OrthancPluginGetErrorDescription;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3430
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3431 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3432 * @brief Get the description of a given error code.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3433 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3434 * This function returns the description of a given error code.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3435 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3436 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3437 * @param error The error code of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3438 * @return The error description. This is a statically-allocated
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3439 * string, do not free it.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3440 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3441 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetErrorDescription(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3442 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3443 OrthancPluginErrorCode error)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3444 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3445 const char* result = NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3446
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3447 _OrthancPluginGetErrorDescription params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3448 params.target = &result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3449 params.error = error;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3450
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3451 if (context->InvokeService(context, _OrthancPluginService_GetErrorDescription, &params) != OrthancPluginErrorCode_Success ||
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3452 result == NULL)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3453 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3454 return "Unknown error code";
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3455 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3456 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3457 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3458 return result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3459 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3460 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3461
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3462
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3463
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3464 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3465 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3466 OrthancPluginRestOutput* output;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3467 uint16_t status;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3468 const char* body;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3469 uint32_t bodySize;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3470 } _OrthancPluginSendHttpStatus;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3471
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3472 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3473 * @brief Send a HTTP status, with a custom body.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3474 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3475 * This function answers to a HTTP request by sending a HTTP status
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3476 * code (such as "400 - Bad Request"), together with a body
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3477 * describing the error. The body will only be returned if the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3478 * configuration option "HttpDescribeErrors" of Orthanc is set to "true".
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3479 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3480 * Note that:
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3481 * - Successful requests (status 200) must use ::OrthancPluginAnswerBuffer().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3482 * - Redirections (status 301) must use ::OrthancPluginRedirect().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3483 * - Unauthorized access (status 401) must use ::OrthancPluginSendUnauthorized().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3484 * - Methods not allowed (status 405) must use ::OrthancPluginSendMethodNotAllowed().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3485 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3486 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3487 * @param output The HTTP connection to the client application.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3488 * @param status The HTTP status code to be sent.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3489 * @param body The body of the answer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3490 * @param bodySize The size of the body.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3491 * @see OrthancPluginSendHttpStatusCode()
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3492 * @ingroup REST
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3493 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3494 ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatus(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3495 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3496 OrthancPluginRestOutput* output,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3497 uint16_t status,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3498 const char* body,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3499 uint32_t bodySize)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3500 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3501 _OrthancPluginSendHttpStatus params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3502 params.output = output;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3503 params.status = status;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3504 params.body = body;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3505 params.bodySize = bodySize;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3506 context->InvokeService(context, _OrthancPluginService_SendHttpStatus, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3507 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3508
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3509
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3510
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3511 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3512 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3513 const OrthancPluginImage* image;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3514 uint32_t* resultUint32;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3515 OrthancPluginPixelFormat* resultPixelFormat;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3516 void** resultBuffer;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3517 } _OrthancPluginGetImageInfo;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3518
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3519
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3520 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3521 * @brief Return the pixel format of an image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3522 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3523 * This function returns the type of memory layout for the pixels of the given image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3524 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3525 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3526 * @param image The image of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3527 * @return The pixel format.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3528 * @ingroup Images
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3529 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3530 ORTHANC_PLUGIN_INLINE OrthancPluginPixelFormat OrthancPluginGetImagePixelFormat(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3531 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3532 const OrthancPluginImage* image)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3533 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3534 OrthancPluginPixelFormat target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3535
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3536 _OrthancPluginGetImageInfo params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3537 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3538 params.image = image;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3539 params.resultPixelFormat = &target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3540
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3541 if (context->InvokeService(context, _OrthancPluginService_GetImagePixelFormat, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3542 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3543 return OrthancPluginPixelFormat_Unknown;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3544 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3545 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3546 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3547 return (OrthancPluginPixelFormat) target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3548 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3549 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3550
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3551
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3552
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3553 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3554 * @brief Return the width of an image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3555 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3556 * This function returns the width of the given image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3557 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3558 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3559 * @param image The image of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3560 * @return The width.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3561 * @ingroup Images
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3562 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3563 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageWidth(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3564 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3565 const OrthancPluginImage* image)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3566 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3567 uint32_t width;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3568
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3569 _OrthancPluginGetImageInfo params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3570 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3571 params.image = image;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3572 params.resultUint32 = &width;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3573
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3574 if (context->InvokeService(context, _OrthancPluginService_GetImageWidth, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3575 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3576 return 0;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3577 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3578 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3579 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3580 return width;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3581 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3582 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3583
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3584
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3585
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3586 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3587 * @brief Return the height of an image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3588 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3589 * This function returns the height of the given image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3590 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3591 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3592 * @param image The image of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3593 * @return The height.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3594 * @ingroup Images
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3595 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3596 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageHeight(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3597 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3598 const OrthancPluginImage* image)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3599 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3600 uint32_t height;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3601
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3602 _OrthancPluginGetImageInfo params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3603 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3604 params.image = image;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3605 params.resultUint32 = &height;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3606
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3607 if (context->InvokeService(context, _OrthancPluginService_GetImageHeight, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3608 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3609 return 0;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3610 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3611 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3612 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3613 return height;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3614 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3615 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3616
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3617
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3618
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3619 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3620 * @brief Return the pitch of an image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3621 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3622 * This function returns the pitch of the given image. The pitch is
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3623 * defined as the number of bytes between 2 successive lines of the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3624 * image in the memory buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3625 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3626 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3627 * @param image The image of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3628 * @return The pitch.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3629 * @ingroup Images
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3630 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3631 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImagePitch(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3632 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3633 const OrthancPluginImage* image)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3634 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3635 uint32_t pitch;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3636
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3637 _OrthancPluginGetImageInfo params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3638 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3639 params.image = image;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3640 params.resultUint32 = &pitch;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3641
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3642 if (context->InvokeService(context, _OrthancPluginService_GetImagePitch, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3643 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3644 return 0;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3645 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3646 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3647 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3648 return pitch;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3649 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3650 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3651
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3652
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3653
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3654 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3655 * @brief Return a pointer to the content of an image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3656 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3657 * This function returns a pointer to the memory buffer that
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3658 * contains the pixels of the image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3659 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3660 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3661 * @param image The image of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3662 * @return The pointer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3663 * @ingroup Images
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3664 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3665 ORTHANC_PLUGIN_INLINE void* OrthancPluginGetImageBuffer(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3666 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3667 const OrthancPluginImage* image)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3668 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3669 void* target = NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3670
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3671 _OrthancPluginGetImageInfo params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3672 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3673 params.resultBuffer = &target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3674 params.image = image;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3675
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3676 if (context->InvokeService(context, _OrthancPluginService_GetImageBuffer, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3677 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3678 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3679 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3680 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3681 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3682 return target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3683 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3684 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3685
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3686
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3687 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3688 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3689 OrthancPluginImage** target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3690 const void* data;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3691 uint32_t size;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3692 OrthancPluginImageFormat format;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3693 } _OrthancPluginUncompressImage;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3694
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3695
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3696 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3697 * @brief Decode a compressed image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3698 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3699 * This function decodes a compressed image from a memory buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3700 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3701 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3702 * @param data Pointer to a memory buffer containing the compressed image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3703 * @param size Size of the memory buffer containing the compressed image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3704 * @param format The file format of the compressed image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3705 * @return The uncompressed image. It must be freed with OrthancPluginFreeImage().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3706 * @ingroup Images
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3707 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3708 ORTHANC_PLUGIN_INLINE OrthancPluginImage *OrthancPluginUncompressImage(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3709 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3710 const void* data,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3711 uint32_t size,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3712 OrthancPluginImageFormat format)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3713 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3714 OrthancPluginImage* target = NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3715
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3716 _OrthancPluginUncompressImage params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3717 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3718 params.target = &target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3719 params.data = data;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3720 params.size = size;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3721 params.format = format;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3722
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3723 if (context->InvokeService(context, _OrthancPluginService_UncompressImage, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3724 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3725 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3726 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3727 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3728 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3729 return target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3730 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3731 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3732
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3733
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3734
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3735
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3736 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3737 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3738 OrthancPluginImage* image;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3739 } _OrthancPluginFreeImage;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3740
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3741 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3742 * @brief Free an image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3743 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3744 * This function frees an image that was decoded with OrthancPluginUncompressImage().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3745 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3746 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3747 * @param image The image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3748 * @ingroup Images
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3749 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3750 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeImage(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3751 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3752 OrthancPluginImage* image)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3753 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3754 _OrthancPluginFreeImage params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3755 params.image = image;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3756
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3757 context->InvokeService(context, _OrthancPluginService_FreeImage, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3758 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3759
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3760
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3761
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3762
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3763 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3764 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3765 OrthancPluginMemoryBuffer* target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3766 OrthancPluginImageFormat imageFormat;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3767 OrthancPluginPixelFormat pixelFormat;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3768 uint32_t width;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3769 uint32_t height;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3770 uint32_t pitch;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3771 const void* buffer;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3772 uint8_t quality;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3773 } _OrthancPluginCompressImage;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3774
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3775
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3776 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3777 * @brief Encode a PNG image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3778 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3779 * This function compresses the given memory buffer containing an
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3780 * image using the PNG specification, and stores the result of the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3781 * compression into a newly allocated memory buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3782 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3783 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3784 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3785 * @param format The memory layout of the uncompressed image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3786 * @param width The width of the image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3787 * @param height The height of the image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3788 * @param pitch The pitch of the image (i.e. the number of bytes
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3789 * between 2 successive lines of the image in the memory buffer).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3790 * @param buffer The memory buffer containing the uncompressed image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3791 * @return 0 if success, or the error code if failure.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3792 * @see OrthancPluginCompressAndAnswerPngImage()
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3793 * @ingroup Images
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3794 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3795 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCompressPngImage(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3796 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3797 OrthancPluginMemoryBuffer* target,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3798 OrthancPluginPixelFormat format,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3799 uint32_t width,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3800 uint32_t height,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3801 uint32_t pitch,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3802 const void* buffer)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3803 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3804 _OrthancPluginCompressImage params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3805 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3806 params.target = target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3807 params.imageFormat = OrthancPluginImageFormat_Png;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3808 params.pixelFormat = format;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3809 params.width = width;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3810 params.height = height;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3811 params.pitch = pitch;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3812 params.buffer = buffer;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3813 params.quality = 0; /* Unused for PNG */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3814
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3815 return context->InvokeService(context, _OrthancPluginService_CompressImage, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3816 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3817
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3818
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3819 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3820 * @brief Encode a JPEG image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3821 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3822 * This function compresses the given memory buffer containing an
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3823 * image using the JPEG specification, and stores the result of the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3824 * compression into a newly allocated memory buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3825 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3826 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3827 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3828 * @param format The memory layout of the uncompressed image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3829 * @param width The width of the image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3830 * @param height The height of the image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3831 * @param pitch The pitch of the image (i.e. the number of bytes
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3832 * between 2 successive lines of the image in the memory buffer).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3833 * @param buffer The memory buffer containing the uncompressed image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3834 * @param quality The quality of the JPEG encoding, between 1 (worst
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3835 * quality, best compression) and 100 (best quality, worst
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3836 * compression).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3837 * @return 0 if success, or the error code if failure.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3838 * @ingroup Images
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3839 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3840 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCompressJpegImage(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3841 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3842 OrthancPluginMemoryBuffer* target,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3843 OrthancPluginPixelFormat format,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3844 uint32_t width,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3845 uint32_t height,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3846 uint32_t pitch,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3847 const void* buffer,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3848 uint8_t quality)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3849 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3850 _OrthancPluginCompressImage params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3851 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3852 params.target = target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3853 params.imageFormat = OrthancPluginImageFormat_Jpeg;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3854 params.pixelFormat = format;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3855 params.width = width;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3856 params.height = height;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3857 params.pitch = pitch;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3858 params.buffer = buffer;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3859 params.quality = quality;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3860
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3861 return context->InvokeService(context, _OrthancPluginService_CompressImage, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3862 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3863
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3864
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3865
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3866 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3867 * @brief Answer to a REST request with a JPEG image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3868 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3869 * This function answers to a REST request with a JPEG image. The
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3870 * parameters of this function describe a memory buffer that
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3871 * contains an uncompressed image. The image will be automatically compressed
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3872 * as a JPEG image by the core system of Orthanc.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3873 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3874 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3875 * @param output The HTTP connection to the client application.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3876 * @param format The memory layout of the uncompressed image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3877 * @param width The width of the image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3878 * @param height The height of the image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3879 * @param pitch The pitch of the image (i.e. the number of bytes
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3880 * between 2 successive lines of the image in the memory buffer).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3881 * @param buffer The memory buffer containing the uncompressed image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3882 * @param quality The quality of the JPEG encoding, between 1 (worst
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3883 * quality, best compression) and 100 (best quality, worst
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3884 * compression).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3885 * @ingroup REST
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3886 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3887 ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerJpegImage(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3888 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3889 OrthancPluginRestOutput* output,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3890 OrthancPluginPixelFormat format,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3891 uint32_t width,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3892 uint32_t height,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3893 uint32_t pitch,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3894 const void* buffer,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3895 uint8_t quality)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3896 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3897 _OrthancPluginCompressAndAnswerImage params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3898 params.output = output;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3899 params.imageFormat = OrthancPluginImageFormat_Jpeg;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3900 params.pixelFormat = format;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3901 params.width = width;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3902 params.height = height;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3903 params.pitch = pitch;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3904 params.buffer = buffer;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3905 params.quality = quality;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3906 context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3907 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3908
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3909
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3910
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3911
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3912 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3913 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3914 OrthancPluginMemoryBuffer* target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3915 OrthancPluginHttpMethod method;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3916 const char* url;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3917 const char* username;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3918 const char* password;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3919 const char* body;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3920 uint32_t bodySize;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3921 } _OrthancPluginCallHttpClient;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3922
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3923
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3924 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3925 * @brief Issue a HTTP GET call.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3926 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3927 * Make a HTTP GET call to the given URL. The result to the query is
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3928 * stored into a newly allocated memory buffer. Favor
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3929 * OrthancPluginRestApiGet() if calling the built-in REST API of the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3930 * Orthanc instance that hosts this plugin.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3931 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3932 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3933 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3934 * @param url The URL of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3935 * @param username The username (can be <tt>NULL</tt> if no password protection).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3936 * @param password The password (can be <tt>NULL</tt> if no password protection).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3937 * @return 0 if success, or the error code if failure.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3938 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3939 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpGet(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3940 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3941 OrthancPluginMemoryBuffer* target,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3942 const char* url,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3943 const char* username,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3944 const char* password)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3945 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3946 _OrthancPluginCallHttpClient params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3947 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3948
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3949 params.target = target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3950 params.method = OrthancPluginHttpMethod_Get;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3951 params.url = url;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3952 params.username = username;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3953 params.password = password;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3954
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3955 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3956 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3957
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3958
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3959 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3960 * @brief Issue a HTTP POST call.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3961 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3962 * Make a HTTP POST call to the given URL. The result to the query
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3963 * is stored into a newly allocated memory buffer. Favor
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3964 * OrthancPluginRestApiPost() if calling the built-in REST API of
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3965 * the Orthanc instance that hosts this plugin.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3966 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3967 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3968 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3969 * @param url The URL of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3970 * @param body The content of the body of the request.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3971 * @param bodySize The size of the body of the request.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3972 * @param username The username (can be <tt>NULL</tt> if no password protection).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3973 * @param password The password (can be <tt>NULL</tt> if no password protection).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3974 * @return 0 if success, or the error code if failure.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3975 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3976 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpPost(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3977 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3978 OrthancPluginMemoryBuffer* target,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3979 const char* url,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3980 const char* body,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3981 uint32_t bodySize,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3982 const char* username,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3983 const char* password)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3984 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3985 _OrthancPluginCallHttpClient params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3986 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3987
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3988 params.target = target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3989 params.method = OrthancPluginHttpMethod_Post;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3990 params.url = url;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3991 params.body = body;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3992 params.bodySize = bodySize;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3993 params.username = username;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3994 params.password = password;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3995
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3996 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3997 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3998
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3999
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4000 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4001 * @brief Issue a HTTP PUT call.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4002 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4003 * Make a HTTP PUT call to the given URL. The result to the query is
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4004 * stored into a newly allocated memory buffer. Favor
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4005 * OrthancPluginRestApiPut() if calling the built-in REST API of the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4006 * Orthanc instance that hosts this plugin.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4007 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4008 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4009 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4010 * @param url The URL of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4011 * @param body The content of the body of the request.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4012 * @param bodySize The size of the body of the request.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4013 * @param username The username (can be <tt>NULL</tt> if no password protection).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4014 * @param password The password (can be <tt>NULL</tt> if no password protection).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4015 * @return 0 if success, or the error code if failure.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4016 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4017 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpPut(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4018 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4019 OrthancPluginMemoryBuffer* target,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4020 const char* url,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4021 const char* body,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4022 uint32_t bodySize,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4023 const char* username,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4024 const char* password)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4025 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4026 _OrthancPluginCallHttpClient params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4027 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4028
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4029 params.target = target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4030 params.method = OrthancPluginHttpMethod_Put;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4031 params.url = url;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4032 params.body = body;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4033 params.bodySize = bodySize;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4034 params.username = username;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4035 params.password = password;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4036
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4037 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4038 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4039
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4040
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4041 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4042 * @brief Issue a HTTP DELETE call.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4043 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4044 * Make a HTTP DELETE call to the given URL. Favor
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4045 * OrthancPluginRestApiDelete() if calling the built-in REST API of
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4046 * the Orthanc instance that hosts this plugin.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4047 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4048 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4049 * @param url The URL of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4050 * @param username The username (can be <tt>NULL</tt> if no password protection).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4051 * @param password The password (can be <tt>NULL</tt> if no password protection).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4052 * @return 0 if success, or the error code if failure.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4053 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4054 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpDelete(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4055 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4056 const char* url,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4057 const char* username,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4058 const char* password)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4059 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4060 _OrthancPluginCallHttpClient params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4061 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4062
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4063 params.method = OrthancPluginHttpMethod_Delete;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4064 params.url = url;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4065 params.username = username;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4066 params.password = password;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4067
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4068 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4069 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4070
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4071
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4072
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4073 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4074 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4075 OrthancPluginImage** target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4076 const OrthancPluginImage* source;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4077 OrthancPluginPixelFormat targetFormat;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4078 } _OrthancPluginConvertPixelFormat;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4079
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4080
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4081 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4082 * @brief Change the pixel format of an image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4083 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4084 * This function creates a new image, changing the memory layout of the pixels.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4085 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4086 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4087 * @param source The source image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4088 * @param targetFormat The target pixel format.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4089 * @return The resulting image. It must be freed with OrthancPluginFreeImage().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4090 * @ingroup Images
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4091 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4092 ORTHANC_PLUGIN_INLINE OrthancPluginImage *OrthancPluginConvertPixelFormat(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4093 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4094 const OrthancPluginImage* source,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4095 OrthancPluginPixelFormat targetFormat)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4096 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4097 OrthancPluginImage* target = NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4098
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4099 _OrthancPluginConvertPixelFormat params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4100 params.target = &target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4101 params.source = source;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4102 params.targetFormat = targetFormat;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4103
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4104 if (context->InvokeService(context, _OrthancPluginService_ConvertPixelFormat, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4105 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4106 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4107 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4108 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4109 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4110 return target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4111 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4112 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4113
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4114
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4115
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4116 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4117 * @brief Return the number of available fonts.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4118 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4119 * This function returns the number of fonts that are built in the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4120 * Orthanc core. These fonts can be used to draw texts on images
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4121 * through OrthancPluginDrawText().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4122 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4123 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4124 * @return The number of fonts.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4125 * @ingroup Images
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4126 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4127 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontsCount(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4128 OrthancPluginContext* context)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4129 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4130 uint32_t count = 0;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4131
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4132 _OrthancPluginReturnSingleValue params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4133 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4134 params.resultUint32 = &count;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4135
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4136 if (context->InvokeService(context, _OrthancPluginService_GetFontsCount, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4137 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4138 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4139 return 0;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4140 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4141 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4142 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4143 return count;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4144 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4145 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4146
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4147
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4148
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4149
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4150 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4151 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4152 uint32_t fontIndex; /* in */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4153 const char** name; /* out */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4154 uint32_t* size; /* out */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4155 } _OrthancPluginGetFontInfo;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4156
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4157 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4158 * @brief Return the name of a font.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4159 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4160 * This function returns the name of a font that is built in the Orthanc core.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4161 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4162 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4163 * @param fontIndex The index of the font. This value must be less than OrthancPluginGetFontsCount().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4164 * @return The font name. This is a statically-allocated string, do not free it.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4165 * @ingroup Images
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4166 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4167 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetFontName(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4168 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4169 uint32_t fontIndex)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4170 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4171 const char* result = NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4172
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4173 _OrthancPluginGetFontInfo params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4174 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4175 params.name = &result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4176 params.fontIndex = fontIndex;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4177
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4178 if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4179 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4180 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4181 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4182 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4183 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4184 return result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4185 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4186 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4187
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4188
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4189 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4190 * @brief Return the size of a font.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4191 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4192 * This function returns the size of a font that is built in the Orthanc core.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4193 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4194 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4195 * @param fontIndex The index of the font. This value must be less than OrthancPluginGetFontsCount().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4196 * @return The font size.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4197 * @ingroup Images
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4198 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4199 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontSize(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4200 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4201 uint32_t fontIndex)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4202 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4203 uint32_t result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4204
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4205 _OrthancPluginGetFontInfo params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4206 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4207 params.size = &result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4208 params.fontIndex = fontIndex;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4209
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4210 if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4211 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4212 return 0;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4213 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4214 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4215 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4216 return result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4217 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4218 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4219
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4220
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4221
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4222 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4223 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4224 OrthancPluginImage* image;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4225 uint32_t fontIndex;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4226 const char* utf8Text;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4227 int32_t x;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4228 int32_t y;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4229 uint8_t r;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4230 uint8_t g;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4231 uint8_t b;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4232 } _OrthancPluginDrawText;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4233
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4234
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4235 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4236 * @brief Draw text on an image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4237 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4238 * This function draws some text on some image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4239 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4240 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4241 * @param image The image upon which to draw the text.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4242 * @param fontIndex The index of the font. This value must be less than OrthancPluginGetFontsCount().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4243 * @param utf8Text The text to be drawn, encoded as an UTF-8 zero-terminated string.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4244 * @param x The X position of the text over the image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4245 * @param y The Y position of the text over the image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4246 * @param r The value of the red color channel of the text.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4247 * @param g The value of the green color channel of the text.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4248 * @param b The value of the blue color channel of the text.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4249 * @return 0 if success, other value if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4250 * @ingroup Images
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4251 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4252 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginDrawText(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4253 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4254 OrthancPluginImage* image,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4255 uint32_t fontIndex,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4256 const char* utf8Text,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4257 int32_t x,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4258 int32_t y,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4259 uint8_t r,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4260 uint8_t g,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4261 uint8_t b)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4262 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4263 _OrthancPluginDrawText params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4264 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4265 params.image = image;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4266 params.fontIndex = fontIndex;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4267 params.utf8Text = utf8Text;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4268 params.x = x;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4269 params.y = y;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4270 params.r = r;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4271 params.g = g;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4272 params.b = b;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4273
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4274 return context->InvokeService(context, _OrthancPluginService_DrawText, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4275 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4276
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4277
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4278
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4279 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4280 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4281 OrthancPluginStorageArea* storageArea;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4282 const char* uuid;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4283 const void* content;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4284 uint64_t size;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4285 OrthancPluginContentType type;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4286 } _OrthancPluginStorageAreaCreate;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4287
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4288
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4289 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4290 * @brief Create a file inside the storage area.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4291 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4292 * This function creates a new file inside the storage area that is
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4293 * currently used by Orthanc.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4294 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4295 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4296 * @param storageArea The storage area.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4297 * @param uuid The identifier of the file to be created.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4298 * @param content The content to store in the newly created file.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4299 * @param size The size of the content.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4300 * @param type The type of the file content.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4301 * @return 0 if success, other value if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4302 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4303 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4304 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaCreate(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4305 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4306 OrthancPluginStorageArea* storageArea,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4307 const char* uuid,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4308 const void* content,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4309 uint64_t size,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4310 OrthancPluginContentType type)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4311 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4312 _OrthancPluginStorageAreaCreate params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4313 params.storageArea = storageArea;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4314 params.uuid = uuid;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4315 params.content = content;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4316 params.size = size;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4317 params.type = type;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4318
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4319 return context->InvokeService(context, _OrthancPluginService_StorageAreaCreate, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4320 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4321
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4322
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4323 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4324 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4325 OrthancPluginMemoryBuffer* target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4326 OrthancPluginStorageArea* storageArea;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4327 const char* uuid;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4328 OrthancPluginContentType type;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4329 } _OrthancPluginStorageAreaRead;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4330
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4331
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4332 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4333 * @brief Read a file from the storage area.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4334 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4335 * This function reads the content of a given file from the storage
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4336 * area that is currently used by Orthanc.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4337 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4338 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4339 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4340 * @param storageArea The storage area.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4341 * @param uuid The identifier of the file to be read.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4342 * @param type The type of the file content.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4343 * @return 0 if success, other value if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4344 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4345 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4346 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaRead(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4347 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4348 OrthancPluginMemoryBuffer* target,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4349 OrthancPluginStorageArea* storageArea,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4350 const char* uuid,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4351 OrthancPluginContentType type)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4352 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4353 _OrthancPluginStorageAreaRead params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4354 params.target = target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4355 params.storageArea = storageArea;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4356 params.uuid = uuid;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4357 params.type = type;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4358
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4359 return context->InvokeService(context, _OrthancPluginService_StorageAreaRead, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4360 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4361
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4362
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4363 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4364 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4365 OrthancPluginStorageArea* storageArea;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4366 const char* uuid;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4367 OrthancPluginContentType type;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4368 } _OrthancPluginStorageAreaRemove;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4369
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4370 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4371 * @brief Remove a file from the storage area.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4372 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4373 * This function removes a given file from the storage area that is
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4374 * currently used by Orthanc.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4375 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4376 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4377 * @param storageArea The storage area.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4378 * @param uuid The identifier of the file to be removed.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4379 * @param type The type of the file content.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4380 * @return 0 if success, other value if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4381 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4382 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4383 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaRemove(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4384 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4385 OrthancPluginStorageArea* storageArea,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4386 const char* uuid,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4387 OrthancPluginContentType type)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4388 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4389 _OrthancPluginStorageAreaRemove params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4390 params.storageArea = storageArea;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4391 params.uuid = uuid;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4392 params.type = type;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4393
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4394 return context->InvokeService(context, _OrthancPluginService_StorageAreaRemove, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4395 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4396
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4397
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4398
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4399 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4400 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4401 OrthancPluginErrorCode* target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4402 int32_t code;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4403 uint16_t httpStatus;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4404 const char* message;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4405 } _OrthancPluginRegisterErrorCode;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4406
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4407 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4408 * @brief Declare a custom error code for this plugin.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4409 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4410 * This function declares a custom error code that can be generated
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4411 * by this plugin. This declaration is used to enrich the body of
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4412 * the HTTP answer in the case of an error, and to set the proper
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4413 * HTTP status code.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4414 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4415 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4416 * @param code The error code that is internal to this plugin.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4417 * @param httpStatus The HTTP status corresponding to this error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4418 * @param message The description of the error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4419 * @return The error code that has been assigned inside the Orthanc core.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4420 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4421 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4422 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterErrorCode(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4423 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4424 int32_t code,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4425 uint16_t httpStatus,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4426 const char* message)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4427 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4428 OrthancPluginErrorCode target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4429
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4430 _OrthancPluginRegisterErrorCode params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4431 params.target = &target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4432 params.code = code;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4433 params.httpStatus = httpStatus;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4434 params.message = message;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4435
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4436 if (context->InvokeService(context, _OrthancPluginService_RegisterErrorCode, &params) == OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4437 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4438 return target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4439 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4440 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4441 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4442 /* There was an error while assigned the error. Use a generic code. */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4443 return OrthancPluginErrorCode_Plugin;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4444 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4445 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4446
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4447
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4448
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4449 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4450 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4451 uint16_t group;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4452 uint16_t element;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4453 OrthancPluginValueRepresentation vr;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4454 const char* name;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4455 uint32_t minMultiplicity;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4456 uint32_t maxMultiplicity;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4457 } _OrthancPluginRegisterDictionaryTag;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4458
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4459 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4460 * @brief Register a new tag into the DICOM dictionary.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4461 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4462 * This function declares a new public tag in the dictionary of
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4463 * DICOM tags that are known to Orthanc. This function should be
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4464 * used in the OrthancPluginInitialize() callback.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4465 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4466 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4467 * @param group The group of the tag.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4468 * @param element The element of the tag.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4469 * @param vr The value representation of the tag.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4470 * @param name The nickname of the tag.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4471 * @param minMultiplicity The minimum multiplicity of the tag (must be above 0).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4472 * @param maxMultiplicity The maximum multiplicity of the tag. A value of 0 means
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4473 * an arbitrary multiplicity ("<tt>n</tt>").
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4474 * @return 0 if success, other value if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4475 * @see OrthancPluginRegisterPrivateDictionaryTag()
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4476 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4477 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4478 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterDictionaryTag(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4479 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4480 uint16_t group,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4481 uint16_t element,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4482 OrthancPluginValueRepresentation vr,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4483 const char* name,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4484 uint32_t minMultiplicity,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4485 uint32_t maxMultiplicity)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4486 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4487 _OrthancPluginRegisterDictionaryTag params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4488 params.group = group;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4489 params.element = element;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4490 params.vr = vr;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4491 params.name = name;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4492 params.minMultiplicity = minMultiplicity;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4493 params.maxMultiplicity = maxMultiplicity;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4494
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4495 return context->InvokeService(context, _OrthancPluginService_RegisterDictionaryTag, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4496 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4497
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4498
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4499
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4500 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4501 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4502 uint16_t group;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4503 uint16_t element;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4504 OrthancPluginValueRepresentation vr;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4505 const char* name;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4506 uint32_t minMultiplicity;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4507 uint32_t maxMultiplicity;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4508 const char* privateCreator;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4509 } _OrthancPluginRegisterPrivateDictionaryTag;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4510
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4511 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4512 * @brief Register a new private tag into the DICOM dictionary.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4513 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4514 * This function declares a new private tag in the dictionary of
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4515 * DICOM tags that are known to Orthanc. This function should be
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4516 * used in the OrthancPluginInitialize() callback.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4517 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4518 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4519 * @param group The group of the tag.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4520 * @param element The element of the tag.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4521 * @param vr The value representation of the tag.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4522 * @param name The nickname of the tag.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4523 * @param minMultiplicity The minimum multiplicity of the tag (must be above 0).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4524 * @param maxMultiplicity The maximum multiplicity of the tag. A value of 0 means
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4525 * an arbitrary multiplicity ("<tt>n</tt>").
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4526 * @param privateCreator The private creator of this private tag.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4527 * @return 0 if success, other value if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4528 * @see OrthancPluginRegisterDictionaryTag()
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4529 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4530 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4531 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterPrivateDictionaryTag(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4532 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4533 uint16_t group,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4534 uint16_t element,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4535 OrthancPluginValueRepresentation vr,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4536 const char* name,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4537 uint32_t minMultiplicity,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4538 uint32_t maxMultiplicity,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4539 const char* privateCreator)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4540 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4541 _OrthancPluginRegisterPrivateDictionaryTag params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4542 params.group = group;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4543 params.element = element;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4544 params.vr = vr;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4545 params.name = name;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4546 params.minMultiplicity = minMultiplicity;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4547 params.maxMultiplicity = maxMultiplicity;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4548 params.privateCreator = privateCreator;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4549
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4550 return context->InvokeService(context, _OrthancPluginService_RegisterPrivateDictionaryTag, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4551 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4552
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4553
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4554
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4555 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4556 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4557 OrthancPluginStorageArea* storageArea;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4558 OrthancPluginResourceType level;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4559 } _OrthancPluginReconstructMainDicomTags;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4560
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4561 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4562 * @brief Reconstruct the main DICOM tags.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4563 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4564 * This function requests the Orthanc core to reconstruct the main
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4565 * DICOM tags of all the resources of the given type. This function
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4566 * can only be used as a part of the upgrade of a custom database
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4567 * back-end. A database transaction will be automatically setup.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4568 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4569 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4570 * @param storageArea The storage area.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4571 * @param level The type of the resources of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4572 * @return 0 if success, other value if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4573 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4574 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4575 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginReconstructMainDicomTags(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4576 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4577 OrthancPluginStorageArea* storageArea,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4578 OrthancPluginResourceType level)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4579 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4580 _OrthancPluginReconstructMainDicomTags params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4581 params.level = level;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4582 params.storageArea = storageArea;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4583
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4584 return context->InvokeService(context, _OrthancPluginService_ReconstructMainDicomTags, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4585 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4586
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4587
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4588 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4589 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4590 char** result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4591 const char* instanceId;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4592 const void* buffer;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4593 uint32_t size;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4594 OrthancPluginDicomToJsonFormat format;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4595 OrthancPluginDicomToJsonFlags flags;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4596 uint32_t maxStringLength;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4597 } _OrthancPluginDicomToJson;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4598
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4599
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4600 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4601 * @brief Format a DICOM memory buffer as a JSON string.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4602 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4603 * This function takes as input a memory buffer containing a DICOM
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4604 * file, and outputs a JSON string representing the tags of this
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4605 * DICOM file.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4606 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4607 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4608 * @param buffer The memory buffer containing the DICOM file.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4609 * @param size The size of the memory buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4610 * @param format The output format.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4611 * @param flags Flags governing the output.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4612 * @param maxStringLength The maximum length of a field. Too long fields will
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4613 * be output as "null". The 0 value means no maximum length.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4614 * @return The NULL value if the case of an error, or the JSON
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4615 * string. This string must be freed by OrthancPluginFreeString().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4616 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4617 * @see OrthancPluginDicomInstanceToJson
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4618 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4619 ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomBufferToJson(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4620 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4621 const void* buffer,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4622 uint32_t size,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4623 OrthancPluginDicomToJsonFormat format,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4624 OrthancPluginDicomToJsonFlags flags,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4625 uint32_t maxStringLength)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4626 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4627 char* result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4628
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4629 _OrthancPluginDicomToJson params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4630 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4631 params.result = &result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4632 params.buffer = buffer;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4633 params.size = size;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4634 params.format = format;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4635 params.flags = flags;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4636 params.maxStringLength = maxStringLength;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4637
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4638 if (context->InvokeService(context, _OrthancPluginService_DicomBufferToJson, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4639 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4640 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4641 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4642 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4643 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4644 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4645 return result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4646 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4647 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4648
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4649
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4650 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4651 * @brief Format a DICOM instance as a JSON string.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4652 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4653 * This function formats a DICOM instance that is stored in Orthanc,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4654 * and outputs a JSON string representing the tags of this DICOM
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4655 * instance.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4656 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4657 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4658 * @param instanceId The Orthanc identifier of the instance.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4659 * @param format The output format.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4660 * @param flags Flags governing the output.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4661 * @param maxStringLength The maximum length of a field. Too long fields will
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4662 * be output as "null". The 0 value means no maximum length.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4663 * @return The NULL value if the case of an error, or the JSON
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4664 * string. This string must be freed by OrthancPluginFreeString().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4665 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4666 * @see OrthancPluginDicomInstanceToJson
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4667 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4668 ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomInstanceToJson(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4669 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4670 const char* instanceId,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4671 OrthancPluginDicomToJsonFormat format,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4672 OrthancPluginDicomToJsonFlags flags,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4673 uint32_t maxStringLength)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4674 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4675 char* result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4676
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4677 _OrthancPluginDicomToJson params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4678 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4679 params.result = &result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4680 params.instanceId = instanceId;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4681 params.format = format;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4682 params.flags = flags;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4683 params.maxStringLength = maxStringLength;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4684
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4685 if (context->InvokeService(context, _OrthancPluginService_DicomInstanceToJson, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4686 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4687 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4688 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4689 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4690 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4691 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4692 return result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4693 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4694 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4695
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4696
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4697 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4698 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4699 OrthancPluginMemoryBuffer* target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4700 const char* uri;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4701 uint32_t headersCount;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4702 const char* const* headersKeys;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4703 const char* const* headersValues;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4704 int32_t afterPlugins;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4705 } _OrthancPluginRestApiGet2;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4706
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4707 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4708 * @brief Make a GET call to the Orthanc REST API, with custom HTTP headers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4709 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4710 * Make a GET call to the Orthanc REST API with extended
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4711 * parameters. The result to the query is stored into a newly
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4712 * allocated memory buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4713 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4714 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4715 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4716 * @param uri The URI in the built-in Orthanc API.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4717 * @param headersCount The number of HTTP headers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4718 * @param headersKeys Array containing the keys of the HTTP headers (can be <tt>NULL</tt> if no header).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4719 * @param headersValues Array containing the values of the HTTP headers (can be <tt>NULL</tt> if no header).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4720 * @param afterPlugins If 0, the built-in API of Orthanc is used.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4721 * If 1, the API is tainted by the plugins.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4722 * @return 0 if success, or the error code if failure.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4723 * @see OrthancPluginRestApiGet, OrthancPluginRestApiGetAfterPlugins
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4724 * @ingroup Orthanc
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4725 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4726 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGet2(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4727 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4728 OrthancPluginMemoryBuffer* target,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4729 const char* uri,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4730 uint32_t headersCount,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4731 const char* const* headersKeys,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4732 const char* const* headersValues,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4733 int32_t afterPlugins)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4734 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4735 _OrthancPluginRestApiGet2 params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4736 params.target = target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4737 params.uri = uri;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4738 params.headersCount = headersCount;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4739 params.headersKeys = headersKeys;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4740 params.headersValues = headersValues;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4741 params.afterPlugins = afterPlugins;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4742
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4743 return context->InvokeService(context, _OrthancPluginService_RestApiGet2, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4744 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4745
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4746
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4747
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4748 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4749 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4750 OrthancPluginWorklistCallback callback;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4751 } _OrthancPluginWorklistCallback;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4752
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4753 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4754 * @brief Register a callback to handle modality worklists requests.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4755 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4756 * This function registers a callback to handle C-Find SCP requests
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4757 * on modality worklists.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4758 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4759 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4760 * @param callback The callback.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4761 * @return 0 if success, other value if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4762 * @ingroup DicomCallbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4763 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4764 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterWorklistCallback(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4765 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4766 OrthancPluginWorklistCallback callback)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4767 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4768 _OrthancPluginWorklistCallback params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4769 params.callback = callback;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4770
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4771 return context->InvokeService(context, _OrthancPluginService_RegisterWorklistCallback, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4772 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4773
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4774
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4775
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4776 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4777 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4778 OrthancPluginWorklistAnswers* answers;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4779 const OrthancPluginWorklistQuery* query;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4780 const void* dicom;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4781 uint32_t size;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4782 } _OrthancPluginWorklistAnswersOperation;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4783
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4784 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4785 * @brief Add one answer to some modality worklist request.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4786 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4787 * This function adds one worklist (encoded as a DICOM file) to the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4788 * set of answers corresponding to some C-Find SCP request against
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4789 * modality worklists.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4790 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4791 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4792 * @param answers The set of answers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4793 * @param query The worklist query, as received by the callback.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4794 * @param dicom The worklist to answer, encoded as a DICOM file.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4795 * @param size The size of the DICOM file.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4796 * @return 0 if success, other value if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4797 * @ingroup DicomCallbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4798 * @see OrthancPluginCreateDicom()
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4799 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4800 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistAddAnswer(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4801 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4802 OrthancPluginWorklistAnswers* answers,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4803 const OrthancPluginWorklistQuery* query,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4804 const void* dicom,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4805 uint32_t size)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4806 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4807 _OrthancPluginWorklistAnswersOperation params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4808 params.answers = answers;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4809 params.query = query;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4810 params.dicom = dicom;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4811 params.size = size;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4812
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4813 return context->InvokeService(context, _OrthancPluginService_WorklistAddAnswer, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4814 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4815
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4816
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4817 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4818 * @brief Mark the set of worklist answers as incomplete.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4819 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4820 * This function marks as incomplete the set of answers
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4821 * corresponding to some C-Find SCP request against modality
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4822 * worklists. This must be used if canceling the handling of a
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4823 * request when too many answers are to be returned.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4824 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4825 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4826 * @param answers The set of answers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4827 * @return 0 if success, other value if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4828 * @ingroup DicomCallbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4829 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4830 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistMarkIncomplete(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4831 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4832 OrthancPluginWorklistAnswers* answers)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4833 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4834 _OrthancPluginWorklistAnswersOperation params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4835 params.answers = answers;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4836 params.query = NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4837 params.dicom = NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4838 params.size = 0;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4839
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4840 return context->InvokeService(context, _OrthancPluginService_WorklistMarkIncomplete, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4841 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4842
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4843
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4844 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4845 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4846 const OrthancPluginWorklistQuery* query;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4847 const void* dicom;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4848 uint32_t size;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4849 int32_t* isMatch;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4850 OrthancPluginMemoryBuffer* target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4851 } _OrthancPluginWorklistQueryOperation;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4852
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4853 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4854 * @brief Test whether a worklist matches the query.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4855 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4856 * This function checks whether one worklist (encoded as a DICOM
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4857 * file) matches the C-Find SCP query against modality
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4858 * worklists. This function must be called before adding the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4859 * worklist as an answer through OrthancPluginWorklistAddAnswer().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4860 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4861 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4862 * @param query The worklist query, as received by the callback.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4863 * @param dicom The worklist to answer, encoded as a DICOM file.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4864 * @param size The size of the DICOM file.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4865 * @return 1 if the worklist matches the query, 0 otherwise.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4866 * @ingroup DicomCallbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4867 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4868 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginWorklistIsMatch(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4869 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4870 const OrthancPluginWorklistQuery* query,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4871 const void* dicom,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4872 uint32_t size)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4873 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4874 int32_t isMatch = 0;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4875
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4876 _OrthancPluginWorklistQueryOperation params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4877 params.query = query;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4878 params.dicom = dicom;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4879 params.size = size;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4880 params.isMatch = &isMatch;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4881 params.target = NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4882
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4883 if (context->InvokeService(context, _OrthancPluginService_WorklistIsMatch, &params) == OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4884 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4885 return isMatch;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4886 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4887 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4888 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4889 /* Error: Assume non-match */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4890 return 0;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4891 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4892 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4893
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4894
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4895 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4896 * @brief Retrieve the worklist query as a DICOM file.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4897 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4898 * This function retrieves the DICOM file that underlies a C-Find
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4899 * SCP query against modality worklists.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4900 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4901 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4902 * @param target Memory buffer where to store the DICOM file. It must be freed with OrthancPluginFreeMemoryBuffer().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4903 * @param query The worklist query, as received by the callback.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4904 * @return 0 if success, other value if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4905 * @ingroup DicomCallbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4906 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4907 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistGetDicomQuery(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4908 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4909 OrthancPluginMemoryBuffer* target,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4910 const OrthancPluginWorklistQuery* query)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4911 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4912 _OrthancPluginWorklistQueryOperation params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4913 params.query = query;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4914 params.dicom = NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4915 params.size = 0;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4916 params.isMatch = NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4917 params.target = target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4918
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4919 return context->InvokeService(context, _OrthancPluginService_WorklistGetDicomQuery, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4920 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4921
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4922
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4923 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4924 * @brief Get the origin of a DICOM file.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4925 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4926 * This function returns the origin of a DICOM instance that has been received by Orthanc.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4927 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4928 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4929 * @param instance The instance of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4930 * @return The origin of the instance.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4931 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4932 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4933 ORTHANC_PLUGIN_INLINE OrthancPluginInstanceOrigin OrthancPluginGetInstanceOrigin(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4934 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4935 OrthancPluginDicomInstance* instance)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4936 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4937 OrthancPluginInstanceOrigin origin;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4938
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4939 _OrthancPluginAccessDicomInstance params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4940 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4941 params.resultOrigin = &origin;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4942 params.instance = instance;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4943
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4944 if (context->InvokeService(context, _OrthancPluginService_GetInstanceOrigin, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4945 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4946 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4947 return OrthancPluginInstanceOrigin_Unknown;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4948 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4949 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4950 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4951 return origin;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4952 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4953 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4954
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4955
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4956 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4957 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4958 OrthancPluginMemoryBuffer* target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4959 const char* json;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4960 const OrthancPluginImage* pixelData;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4961 OrthancPluginCreateDicomFlags flags;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4962 } _OrthancPluginCreateDicom;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4963
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4964 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4965 * @brief Create a DICOM instance from a JSON string and an image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4966 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4967 * This function takes as input a string containing a JSON file
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4968 * describing the content of a DICOM instance. As an output, it
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4969 * writes the corresponding DICOM instance to a newly allocated
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4970 * memory buffer. Additionally, an image to be encoded within the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4971 * DICOM instance can also be provided.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4972 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4973 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4974 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4975 * @param json The input JSON file.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4976 * @param pixelData The image. Can be NULL, if the pixel data is encoded inside the JSON with the data URI scheme.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4977 * @param flags Flags governing the output.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4978 * @return 0 if success, other value if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4979 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4980 * @see OrthancPluginDicomBufferToJson
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4981 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4982 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCreateDicom(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4983 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4984 OrthancPluginMemoryBuffer* target,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4985 const char* json,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4986 const OrthancPluginImage* pixelData,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4987 OrthancPluginCreateDicomFlags flags)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4988 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4989 _OrthancPluginCreateDicom params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4990 params.target = target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4991 params.json = json;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4992 params.pixelData = pixelData;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4993 params.flags = flags;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4994
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4995 return context->InvokeService(context, _OrthancPluginService_CreateDicom, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4996 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4997
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4998
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4999 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5000 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5001 OrthancPluginDecodeImageCallback callback;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5002 } _OrthancPluginDecodeImageCallback;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5003
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5004 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5005 * @brief Register a callback to handle the decoding of DICOM images.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5006 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5007 * This function registers a custom callback to the decoding of
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5008 * DICOM images, replacing the built-in decoder of Orthanc.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5009 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5010 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5011 * @param callback The callback.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5012 * @return 0 if success, other value if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5013 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5014 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5015 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterDecodeImageCallback(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5016 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5017 OrthancPluginDecodeImageCallback callback)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5018 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5019 _OrthancPluginDecodeImageCallback params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5020 params.callback = callback;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5021
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5022 return context->InvokeService(context, _OrthancPluginService_RegisterDecodeImageCallback, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5023 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5024
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5025
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5026
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5027 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5028 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5029 OrthancPluginImage** target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5030 OrthancPluginPixelFormat format;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5031 uint32_t width;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5032 uint32_t height;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5033 uint32_t pitch;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5034 void* buffer;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5035 const void* constBuffer;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5036 uint32_t bufferSize;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5037 uint32_t frameIndex;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5038 } _OrthancPluginCreateImage;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5039
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5040
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5041 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5042 * @brief Create an image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5043 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5044 * This function creates an image of given size and format.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5045 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5046 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5047 * @param format The format of the pixels.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5048 * @param width The width of the image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5049 * @param height The height of the image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5050 * @return The newly allocated image. It must be freed with OrthancPluginFreeImage().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5051 * @ingroup Images
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5052 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5053 ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginCreateImage(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5054 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5055 OrthancPluginPixelFormat format,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5056 uint32_t width,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5057 uint32_t height)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5058 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5059 OrthancPluginImage* target = NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5060
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5061 _OrthancPluginCreateImage params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5062 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5063 params.target = &target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5064 params.format = format;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5065 params.width = width;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5066 params.height = height;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5067
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5068 if (context->InvokeService(context, _OrthancPluginService_CreateImage, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5069 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5070 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5071 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5072 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5073 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5074 return target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5075 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5076 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5077
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5078
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5079 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5080 * @brief Create an image pointing to a memory buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5081 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5082 * This function creates an image whose content points to a memory
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5083 * buffer managed by the plugin. Note that the buffer is directly
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5084 * accessed, no memory is allocated and no data is copied.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5085 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5086 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5087 * @param format The format of the pixels.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5088 * @param width The width of the image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5089 * @param height The height of the image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5090 * @param pitch The pitch of the image (i.e. the number of bytes
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5091 * between 2 successive lines of the image in the memory buffer).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5092 * @param buffer The memory buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5093 * @return The newly allocated image. It must be freed with OrthancPluginFreeImage().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5094 * @ingroup Images
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5095 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5096 ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginCreateImageAccessor(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5097 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5098 OrthancPluginPixelFormat format,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5099 uint32_t width,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5100 uint32_t height,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5101 uint32_t pitch,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5102 void* buffer)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5103 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5104 OrthancPluginImage* target = NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5105
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5106 _OrthancPluginCreateImage params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5107 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5108 params.target = &target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5109 params.format = format;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5110 params.width = width;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5111 params.height = height;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5112 params.pitch = pitch;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5113 params.buffer = buffer;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5114
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5115 if (context->InvokeService(context, _OrthancPluginService_CreateImageAccessor, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5116 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5117 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5118 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5119 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5120 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5121 return target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5122 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5123 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5124
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5125
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5126
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5127 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5128 * @brief Decode one frame from a DICOM instance.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5129 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5130 * This function decodes one frame of a DICOM image that is stored
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5131 * in a memory buffer. This function will give the same result as
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5132 * OrthancPluginUncompressImage() for single-frame DICOM images.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5133 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5134 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5135 * @param buffer Pointer to a memory buffer containing the DICOM image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5136 * @param bufferSize Size of the memory buffer containing the DICOM image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5137 * @param frameIndex The index of the frame of interest in a multi-frame image.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5138 * @return The uncompressed image. It must be freed with OrthancPluginFreeImage().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5139 * @ingroup Images
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5140 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5141 ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginDecodeDicomImage(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5142 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5143 const void* buffer,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5144 uint32_t bufferSize,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5145 uint32_t frameIndex)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5146 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5147 OrthancPluginImage* target = NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5148
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5149 _OrthancPluginCreateImage params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5150 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5151 params.target = &target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5152 params.constBuffer = buffer;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5153 params.bufferSize = bufferSize;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5154 params.frameIndex = frameIndex;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5155
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5156 if (context->InvokeService(context, _OrthancPluginService_DecodeDicomImage, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5157 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5158 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5159 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5160 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5161 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5162 return target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5163 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5164 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5165
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5166
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5167
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5168 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5169 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5170 char** result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5171 const void* buffer;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5172 uint32_t size;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5173 } _OrthancPluginComputeHash;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5174
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5175 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5176 * @brief Compute an MD5 hash.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5177 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5178 * This functions computes the MD5 cryptographic hash of the given memory buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5179 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5180 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5181 * @param buffer The source memory buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5182 * @param size The size in bytes of the source buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5183 * @return The NULL value in case of error, or a string containing the cryptographic hash.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5184 * This string must be freed by OrthancPluginFreeString().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5185 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5186 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5187 ORTHANC_PLUGIN_INLINE char* OrthancPluginComputeMd5(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5188 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5189 const void* buffer,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5190 uint32_t size)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5191 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5192 char* result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5193
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5194 _OrthancPluginComputeHash params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5195 params.result = &result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5196 params.buffer = buffer;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5197 params.size = size;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5198
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5199 if (context->InvokeService(context, _OrthancPluginService_ComputeMd5, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5200 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5201 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5202 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5203 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5204 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5205 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5206 return result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5207 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5208 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5209
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5210
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5211 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5212 * @brief Compute a SHA-1 hash.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5213 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5214 * This functions computes the SHA-1 cryptographic hash of the given memory buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5215 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5216 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5217 * @param buffer The source memory buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5218 * @param size The size in bytes of the source buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5219 * @return The NULL value in case of error, or a string containing the cryptographic hash.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5220 * This string must be freed by OrthancPluginFreeString().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5221 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5222 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5223 ORTHANC_PLUGIN_INLINE char* OrthancPluginComputeSha1(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5224 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5225 const void* buffer,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5226 uint32_t size)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5227 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5228 char* result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5229
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5230 _OrthancPluginComputeHash params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5231 params.result = &result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5232 params.buffer = buffer;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5233 params.size = size;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5234
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5235 if (context->InvokeService(context, _OrthancPluginService_ComputeSha1, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5236 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5237 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5238 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5239 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5240 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5241 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5242 return result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5243 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5244 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5245
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5246
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5247
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5248 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5249 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5250 OrthancPluginDictionaryEntry* target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5251 const char* name;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5252 } _OrthancPluginLookupDictionary;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5253
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5254 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5255 * @brief Get information about the given DICOM tag.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5256 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5257 * This functions makes a lookup in the dictionary of DICOM tags
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5258 * that are known to Orthanc, and returns information about this
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5259 * tag. The tag can be specified using its human-readable name
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5260 * (e.g. "PatientName") or a set of two hexadecimal numbers
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5261 * (e.g. "0010-0020").
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5262 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5263 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5264 * @param target Where to store the information about the tag.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5265 * @param name The name of the DICOM tag.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5266 * @return 0 if success, other value if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5267 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5268 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5269 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginLookupDictionary(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5270 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5271 OrthancPluginDictionaryEntry* target,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5272 const char* name)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5273 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5274 _OrthancPluginLookupDictionary params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5275 params.target = target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5276 params.name = name;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5277 return context->InvokeService(context, _OrthancPluginService_LookupDictionary, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5278 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5279
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5280
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5281
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5282 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5283 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5284 OrthancPluginRestOutput* output;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5285 const char* answer;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5286 uint32_t answerSize;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5287 uint32_t headersCount;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5288 const char* const* headersKeys;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5289 const char* const* headersValues;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5290 } _OrthancPluginSendMultipartItem2;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5291
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5292 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5293 * @brief Send an item as a part of some HTTP multipart answer, with custom headers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5294 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5295 * This function sends an item as a part of some HTTP multipart
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5296 * answer that was initiated by OrthancPluginStartMultipartAnswer(). In addition to
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5297 * OrthancPluginSendMultipartItem(), this function will set HTTP header associated
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5298 * with the item.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5299 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5300 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5301 * @param output The HTTP connection to the client application.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5302 * @param answer Pointer to the memory buffer containing the item.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5303 * @param answerSize Number of bytes of the item.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5304 * @param headersCount The number of HTTP headers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5305 * @param headersKeys Array containing the keys of the HTTP headers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5306 * @param headersValues Array containing the values of the HTTP headers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5307 * @return 0 if success, or the error code if failure (this notably happens
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5308 * if the connection is closed by the client).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5309 * @see OrthancPluginSendMultipartItem()
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5310 * @ingroup REST
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5311 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5312 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSendMultipartItem2(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5313 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5314 OrthancPluginRestOutput* output,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5315 const char* answer,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5316 uint32_t answerSize,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5317 uint32_t headersCount,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5318 const char* const* headersKeys,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5319 const char* const* headersValues)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5320 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5321 _OrthancPluginSendMultipartItem2 params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5322 params.output = output;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5323 params.answer = answer;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5324 params.answerSize = answerSize;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5325 params.headersCount = headersCount;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5326 params.headersKeys = headersKeys;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5327 params.headersValues = headersValues;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5328
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5329 return context->InvokeService(context, _OrthancPluginService_SendMultipartItem2, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5330 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5331
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5332
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5333 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5334 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5335 OrthancPluginIncomingHttpRequestFilter callback;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5336 } _OrthancPluginIncomingHttpRequestFilter;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5337
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5338 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5339 * @brief Register a callback to filter incoming HTTP requests.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5340 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5341 * This function registers a custom callback to filter incoming HTTP/REST
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5342 * requests received by the HTTP server of Orthanc.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5343 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5344 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5345 * @param callback The callback.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5346 * @return 0 if success, other value if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5347 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5348 * @deprecated Please instead use OrthancPluginRegisterIncomingHttpRequestFilter2()
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5349 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5350 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5351 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5352 OrthancPluginIncomingHttpRequestFilter callback)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5353 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5354 _OrthancPluginIncomingHttpRequestFilter params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5355 params.callback = callback;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5356
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5357 return context->InvokeService(context, _OrthancPluginService_RegisterIncomingHttpRequestFilter, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5358 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5359
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5360
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5361
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5362 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5363 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5364 OrthancPluginMemoryBuffer* answerBody;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5365 OrthancPluginMemoryBuffer* answerHeaders;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5366 uint16_t* httpStatus;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5367 OrthancPluginHttpMethod method;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5368 const char* url;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5369 uint32_t headersCount;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5370 const char* const* headersKeys;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5371 const char* const* headersValues;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5372 const char* body;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5373 uint32_t bodySize;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5374 const char* username;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5375 const char* password;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5376 uint32_t timeout;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5377 const char* certificateFile;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5378 const char* certificateKeyFile;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5379 const char* certificateKeyPassword;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5380 uint8_t pkcs11;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5381 } _OrthancPluginCallHttpClient2;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5382
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5383
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5384
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5385 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5386 * @brief Issue a HTTP call with full flexibility.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5387 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5388 * Make a HTTP call to the given URL. The result to the query is
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5389 * stored into a newly allocated memory buffer. The HTTP request
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5390 * will be done accordingly to the global configuration of Orthanc
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5391 * (in particular, the options "HttpProxy", "HttpTimeout",
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5392 * "HttpsVerifyPeers", "HttpsCACertificates", and "Pkcs11" will be
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5393 * taken into account).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5394 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5395 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5396 * @param answerBody The target memory buffer (out argument).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5397 * It must be freed with OrthancPluginFreeMemoryBuffer().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5398 * @param answerHeaders The target memory buffer for the HTTP headers in the answers (out argument).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5399 * The answer headers are formatted as a JSON object (associative array).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5400 * The buffer must be freed with OrthancPluginFreeMemoryBuffer().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5401 * This argument can be set to NULL if the plugin has no interest in the HTTP headers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5402 * @param httpStatus The HTTP status after the execution of the request (out argument).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5403 * @param method HTTP method to be used.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5404 * @param url The URL of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5405 * @param headersCount The number of HTTP headers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5406 * @param headersKeys Array containing the keys of the HTTP headers (can be <tt>NULL</tt> if no header).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5407 * @param headersValues Array containing the values of the HTTP headers (can be <tt>NULL</tt> if no header).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5408 * @param username The username (can be <tt>NULL</tt> if no password protection).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5409 * @param password The password (can be <tt>NULL</tt> if no password protection).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5410 * @param body The HTTP body for a POST or PUT request.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5411 * @param bodySize The size of the body.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5412 * @param timeout Timeout in seconds (0 for default timeout).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5413 * @param certificateFile Path to the client certificate for HTTPS, in PEM format
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5414 * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5415 * @param certificateKeyFile Path to the key of the client certificate for HTTPS, in PEM format
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5416 * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5417 * @param certificateKeyPassword Password to unlock the key of the client certificate
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5418 * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5419 * @param pkcs11 Enable PKCS#11 client authentication for hardware security modules and smart cards.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5420 * @return 0 if success, or the error code if failure.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5421 * @see OrthancPluginCallPeerApi()
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5422 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5423 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpClient(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5424 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5425 OrthancPluginMemoryBuffer* answerBody,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5426 OrthancPluginMemoryBuffer* answerHeaders,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5427 uint16_t* httpStatus,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5428 OrthancPluginHttpMethod method,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5429 const char* url,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5430 uint32_t headersCount,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5431 const char* const* headersKeys,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5432 const char* const* headersValues,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5433 const char* body,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5434 uint32_t bodySize,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5435 const char* username,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5436 const char* password,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5437 uint32_t timeout,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5438 const char* certificateFile,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5439 const char* certificateKeyFile,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5440 const char* certificateKeyPassword,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5441 uint8_t pkcs11)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5442 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5443 _OrthancPluginCallHttpClient2 params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5444 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5445
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5446 params.answerBody = answerBody;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5447 params.answerHeaders = answerHeaders;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5448 params.httpStatus = httpStatus;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5449 params.method = method;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5450 params.url = url;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5451 params.headersCount = headersCount;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5452 params.headersKeys = headersKeys;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5453 params.headersValues = headersValues;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5454 params.body = body;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5455 params.bodySize = bodySize;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5456 params.username = username;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5457 params.password = password;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5458 params.timeout = timeout;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5459 params.certificateFile = certificateFile;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5460 params.certificateKeyFile = certificateKeyFile;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5461 params.certificateKeyPassword = certificateKeyPassword;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5462 params.pkcs11 = pkcs11;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5463
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5464 return context->InvokeService(context, _OrthancPluginService_CallHttpClient2, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5465 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5466
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5467
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5468 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5469 * @brief Generate an UUID.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5470 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5471 * Generate a random GUID/UUID (globally unique identifier).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5472 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5473 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5474 * @return NULL in the case of an error, or a newly allocated string
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5475 * containing the UUID. This string must be freed by OrthancPluginFreeString().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5476 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5477 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5478 ORTHANC_PLUGIN_INLINE char* OrthancPluginGenerateUuid(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5479 OrthancPluginContext* context)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5480 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5481 char* result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5482
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5483 _OrthancPluginRetrieveDynamicString params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5484 params.result = &result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5485 params.argument = NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5486
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5487 if (context->InvokeService(context, _OrthancPluginService_GenerateUuid, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5488 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5489 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5490 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5491 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5492 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5493 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5494 return result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5495 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5496 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5497
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5498
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5499
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5500
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5501 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5502 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5503 OrthancPluginFindCallback callback;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5504 } _OrthancPluginFindCallback;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5505
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5506 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5507 * @brief Register a callback to handle C-Find requests.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5508 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5509 * This function registers a callback to handle C-Find SCP requests
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5510 * that are not related to modality worklists.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5511 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5512 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5513 * @param callback The callback.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5514 * @return 0 if success, other value if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5515 * @ingroup DicomCallbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5516 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5517 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterFindCallback(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5518 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5519 OrthancPluginFindCallback callback)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5520 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5521 _OrthancPluginFindCallback params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5522 params.callback = callback;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5523
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5524 return context->InvokeService(context, _OrthancPluginService_RegisterFindCallback, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5525 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5526
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5527
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5528 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5529 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5530 OrthancPluginFindAnswers *answers;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5531 const OrthancPluginFindQuery *query;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5532 const void *dicom;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5533 uint32_t size;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5534 uint32_t index;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5535 uint32_t *resultUint32;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5536 uint16_t *resultGroup;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5537 uint16_t *resultElement;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5538 char **resultString;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5539 } _OrthancPluginFindOperation;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5540
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5541 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5542 * @brief Add one answer to some C-Find request.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5543 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5544 * This function adds one answer (encoded as a DICOM file) to the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5545 * set of answers corresponding to some C-Find SCP request that is
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5546 * not related to modality worklists.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5547 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5548 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5549 * @param answers The set of answers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5550 * @param dicom The answer to be added, encoded as a DICOM file.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5551 * @param size The size of the DICOM file.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5552 * @return 0 if success, other value if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5553 * @ingroup DicomCallbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5554 * @see OrthancPluginCreateDicom()
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5555 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5556 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginFindAddAnswer(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5557 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5558 OrthancPluginFindAnswers* answers,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5559 const void* dicom,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5560 uint32_t size)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5561 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5562 _OrthancPluginFindOperation params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5563 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5564 params.answers = answers;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5565 params.dicom = dicom;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5566 params.size = size;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5567
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5568 return context->InvokeService(context, _OrthancPluginService_FindAddAnswer, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5569 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5570
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5571
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5572 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5573 * @brief Mark the set of C-Find answers as incomplete.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5574 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5575 * This function marks as incomplete the set of answers
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5576 * corresponding to some C-Find SCP request that is not related to
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5577 * modality worklists. This must be used if canceling the handling
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5578 * of a request when too many answers are to be returned.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5579 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5580 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5581 * @param answers The set of answers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5582 * @return 0 if success, other value if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5583 * @ingroup DicomCallbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5584 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5585 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginFindMarkIncomplete(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5586 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5587 OrthancPluginFindAnswers* answers)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5588 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5589 _OrthancPluginFindOperation params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5590 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5591 params.answers = answers;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5592
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5593 return context->InvokeService(context, _OrthancPluginService_FindMarkIncomplete, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5594 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5595
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5596
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5597
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5598 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5599 * @brief Get the number of tags in a C-Find query.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5600 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5601 * This function returns the number of tags that are contained in
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5602 * the given C-Find query.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5603 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5604 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5605 * @param query The C-Find query.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5606 * @return The number of tags.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5607 * @ingroup DicomCallbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5608 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5609 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFindQuerySize(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5610 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5611 const OrthancPluginFindQuery* query)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5612 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5613 uint32_t count = 0;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5614
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5615 _OrthancPluginFindOperation params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5616 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5617 params.query = query;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5618 params.resultUint32 = &count;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5619
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5620 if (context->InvokeService(context, _OrthancPluginService_GetFindQuerySize, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5621 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5622 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5623 return 0;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5624 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5625 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5626 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5627 return count;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5628 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5629 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5630
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5631
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5632 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5633 * @brief Get one tag in a C-Find query.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5634 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5635 * This function returns the group and the element of one DICOM tag
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5636 * in the given C-Find query.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5637 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5638 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5639 * @param group The group of the tag (output).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5640 * @param element The element of the tag (output).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5641 * @param query The C-Find query.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5642 * @param index The index of the tag of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5643 * @return 0 if success, other value if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5644 * @ingroup DicomCallbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5645 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5646 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginGetFindQueryTag(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5647 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5648 uint16_t* group,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5649 uint16_t* element,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5650 const OrthancPluginFindQuery* query,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5651 uint32_t index)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5652 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5653 _OrthancPluginFindOperation params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5654 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5655 params.query = query;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5656 params.index = index;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5657 params.resultGroup = group;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5658 params.resultElement = element;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5659
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5660 return context->InvokeService(context, _OrthancPluginService_GetFindQueryTag, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5661 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5662
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5663
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5664 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5665 * @brief Get the symbolic name of one tag in a C-Find query.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5666 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5667 * This function returns the symbolic name of one DICOM tag in the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5668 * given C-Find query.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5669 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5670 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5671 * @param query The C-Find query.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5672 * @param index The index of the tag of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5673 * @return The NULL value in case of error, or a string containing the name of the tag.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5674 * @return 0 if success, other value if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5675 * @ingroup DicomCallbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5676 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5677 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetFindQueryTagName(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5678 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5679 const OrthancPluginFindQuery* query,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5680 uint32_t index)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5681 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5682 char* result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5683
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5684 _OrthancPluginFindOperation params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5685 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5686 params.query = query;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5687 params.index = index;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5688 params.resultString = &result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5689
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5690 if (context->InvokeService(context, _OrthancPluginService_GetFindQueryTagName, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5691 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5692 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5693 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5694 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5695 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5696 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5697 return result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5698 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5699 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5700
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5701
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5702 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5703 * @brief Get the value associated with one tag in a C-Find query.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5704 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5705 * This function returns the value associated with one tag in the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5706 * given C-Find query.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5707 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5708 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5709 * @param query The C-Find query.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5710 * @param index The index of the tag of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5711 * @return The NULL value in case of error, or a string containing the value of the tag.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5712 * @return 0 if success, other value if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5713 * @ingroup DicomCallbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5714 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5715 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetFindQueryValue(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5716 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5717 const OrthancPluginFindQuery* query,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5718 uint32_t index)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5719 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5720 char* result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5721
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5722 _OrthancPluginFindOperation params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5723 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5724 params.query = query;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5725 params.index = index;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5726 params.resultString = &result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5727
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5728 if (context->InvokeService(context, _OrthancPluginService_GetFindQueryValue, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5729 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5730 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5731 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5732 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5733 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5734 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5735 return result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5736 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5737 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5738
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5739
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5740
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5741
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5742 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5743 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5744 OrthancPluginMoveCallback callback;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5745 OrthancPluginGetMoveSize getMoveSize;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5746 OrthancPluginApplyMove applyMove;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5747 OrthancPluginFreeMove freeMove;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5748 } _OrthancPluginMoveCallback;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5749
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5750 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5751 * @brief Register a callback to handle C-Move requests.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5752 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5753 * This function registers a callback to handle C-Move SCP requests.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5754 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5755 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5756 * @param callback The main callback.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5757 * @param getMoveSize Callback to read the number of C-Move suboperations.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5758 * @param applyMove Callback to apply one C-Move suboperations.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5759 * @param freeMove Callback to free the C-Move driver.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5760 * @return 0 if success, other value if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5761 * @ingroup DicomCallbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5762 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5763 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterMoveCallback(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5764 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5765 OrthancPluginMoveCallback callback,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5766 OrthancPluginGetMoveSize getMoveSize,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5767 OrthancPluginApplyMove applyMove,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5768 OrthancPluginFreeMove freeMove)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5769 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5770 _OrthancPluginMoveCallback params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5771 params.callback = callback;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5772 params.getMoveSize = getMoveSize;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5773 params.applyMove = applyMove;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5774 params.freeMove = freeMove;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5775
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5776 return context->InvokeService(context, _OrthancPluginService_RegisterMoveCallback, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5777 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5778
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5779
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5780
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5781 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5782 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5783 OrthancPluginFindMatcher** target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5784 const void* query;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5785 uint32_t size;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5786 } _OrthancPluginCreateFindMatcher;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5787
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5788
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5789 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5790 * @brief Create a C-Find matcher.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5791 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5792 * This function creates a "matcher" object that can be used to
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5793 * check whether a DICOM instance matches a C-Find query. The C-Find
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5794 * query must be expressed as a DICOM buffer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5795 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5796 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5797 * @param query The C-Find DICOM query.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5798 * @param size The size of the DICOM query.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5799 * @return The newly allocated matcher. It must be freed with OrthancPluginFreeFindMatcher().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5800 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5801 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5802 ORTHANC_PLUGIN_INLINE OrthancPluginFindMatcher* OrthancPluginCreateFindMatcher(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5803 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5804 const void* query,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5805 uint32_t size)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5806 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5807 OrthancPluginFindMatcher* target = NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5808
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5809 _OrthancPluginCreateFindMatcher params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5810 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5811 params.target = &target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5812 params.query = query;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5813 params.size = size;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5814
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5815 if (context->InvokeService(context, _OrthancPluginService_CreateFindMatcher, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5816 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5817 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5818 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5819 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5820 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5821 return target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5822 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5823 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5824
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5825
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5826 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5827 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5828 OrthancPluginFindMatcher* matcher;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5829 } _OrthancPluginFreeFindMatcher;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5830
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5831 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5832 * @brief Free a C-Find matcher.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5833 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5834 * This function frees a matcher that was created using OrthancPluginCreateFindMatcher().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5835 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5836 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5837 * @param matcher The matcher of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5838 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5839 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5840 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeFindMatcher(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5841 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5842 OrthancPluginFindMatcher* matcher)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5843 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5844 _OrthancPluginFreeFindMatcher params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5845 params.matcher = matcher;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5846
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5847 context->InvokeService(context, _OrthancPluginService_FreeFindMatcher, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5848 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5849
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5850
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5851 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5852 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5853 const OrthancPluginFindMatcher* matcher;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5854 const void* dicom;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5855 uint32_t size;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5856 int32_t* isMatch;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5857 } _OrthancPluginFindMatcherIsMatch;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5858
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5859 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5860 * @brief Test whether a DICOM instance matches a C-Find query.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5861 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5862 * This function checks whether one DICOM instance matches C-Find
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5863 * matcher that was previously allocated using
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5864 * OrthancPluginCreateFindMatcher().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5865 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5866 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5867 * @param matcher The matcher of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5868 * @param dicom The DICOM instance to be matched.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5869 * @param size The size of the DICOM instance.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5870 * @return 1 if the DICOM instance matches the query, 0 otherwise.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5871 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5872 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5873 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginFindMatcherIsMatch(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5874 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5875 const OrthancPluginFindMatcher* matcher,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5876 const void* dicom,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5877 uint32_t size)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5878 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5879 int32_t isMatch = 0;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5880
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5881 _OrthancPluginFindMatcherIsMatch params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5882 params.matcher = matcher;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5883 params.dicom = dicom;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5884 params.size = size;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5885 params.isMatch = &isMatch;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5886
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5887 if (context->InvokeService(context, _OrthancPluginService_FindMatcherIsMatch, &params) == OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5888 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5889 return isMatch;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5890 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5891 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5892 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5893 /* Error: Assume non-match */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5894 return 0;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5895 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5896 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5897
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5898
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5899 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5900 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5901 OrthancPluginIncomingHttpRequestFilter2 callback;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5902 } _OrthancPluginIncomingHttpRequestFilter2;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5903
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5904 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5905 * @brief Register a callback to filter incoming HTTP requests.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5906 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5907 * This function registers a custom callback to filter incoming HTTP/REST
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5908 * requests received by the HTTP server of Orthanc.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5909 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5910 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5911 * @param callback The callback.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5912 * @return 0 if success, other value if error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5913 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5914 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5915 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter2(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5916 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5917 OrthancPluginIncomingHttpRequestFilter2 callback)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5918 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5919 _OrthancPluginIncomingHttpRequestFilter2 params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5920 params.callback = callback;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5921
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5922 return context->InvokeService(context, _OrthancPluginService_RegisterIncomingHttpRequestFilter2, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5923 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5924
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5925
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5926
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5927 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5928 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5929 OrthancPluginPeers** peers;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5930 } _OrthancPluginGetPeers;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5931
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5932 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5933 * @brief Return the list of available Orthanc peers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5934 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5935 * This function returns the parameters of the Orthanc peers that are known to
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5936 * the Orthanc server hosting the plugin.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5937 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5938 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5939 * @return NULL if error, or a newly allocated opaque data structure containing the peers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5940 * This structure must be freed with OrthancPluginFreePeers().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5941 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5942 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5943 ORTHANC_PLUGIN_INLINE OrthancPluginPeers* OrthancPluginGetPeers(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5944 OrthancPluginContext* context)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5945 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5946 OrthancPluginPeers* peers = NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5947
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5948 _OrthancPluginGetPeers params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5949 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5950 params.peers = &peers;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5951
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5952 if (context->InvokeService(context, _OrthancPluginService_GetPeers, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5953 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5954 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5955 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5956 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5957 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5958 return peers;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5959 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5960 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5961
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5962
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5963 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5964 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5965 OrthancPluginPeers* peers;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5966 } _OrthancPluginFreePeers;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5967
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5968 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5969 * @brief Free the list of available Orthanc peers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5970 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5971 * This function frees the data structure returned by OrthancPluginGetPeers().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5972 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5973 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5974 * @param peers The data structure describing the Orthanc peers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5975 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5976 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5977 ORTHANC_PLUGIN_INLINE void OrthancPluginFreePeers(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5978 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5979 OrthancPluginPeers* peers)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5980 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5981 _OrthancPluginFreePeers params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5982 params.peers = peers;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5983
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5984 context->InvokeService(context, _OrthancPluginService_FreePeers, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5985 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5986
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5987
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5988 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5989 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5990 uint32_t* target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5991 const OrthancPluginPeers* peers;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5992 } _OrthancPluginGetPeersCount;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5993
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5994 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5995 * @brief Get the number of Orthanc peers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5996 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5997 * This function returns the number of Orthanc peers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5998 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5999 * This function is thread-safe: Several threads sharing the same
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6000 * OrthancPluginPeers object can simultaneously call this function.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6001 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6002 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6003 * @param peers The data structure describing the Orthanc peers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6004 * @result The number of peers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6005 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6006 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6007 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetPeersCount(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6008 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6009 const OrthancPluginPeers* peers)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6010 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6011 uint32_t target = 0;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6012
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6013 _OrthancPluginGetPeersCount params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6014 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6015 params.target = &target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6016 params.peers = peers;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6017
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6018 if (context->InvokeService(context, _OrthancPluginService_GetPeersCount, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6019 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6020 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6021 return 0;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6022 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6023 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6024 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6025 return target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6026 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6027 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6028
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6029
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6030 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6031 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6032 const char** target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6033 const OrthancPluginPeers* peers;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6034 uint32_t peerIndex;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6035 const char* userProperty;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6036 } _OrthancPluginGetPeerProperty;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6037
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6038 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6039 * @brief Get the symbolic name of an Orthanc peer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6040 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6041 * This function returns the symbolic name of the Orthanc peer,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6042 * which corresponds to the key of the "OrthancPeers" configuration
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6043 * option of Orthanc.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6044 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6045 * This function is thread-safe: Several threads sharing the same
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6046 * OrthancPluginPeers object can simultaneously call this function.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6047 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6048 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6049 * @param peers The data structure describing the Orthanc peers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6050 * @param peerIndex The index of the peer of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6051 * This value must be lower than OrthancPluginGetPeersCount().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6052 * @result The symbolic name, or NULL in the case of an error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6053 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6054 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6055 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetPeerName(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6056 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6057 const OrthancPluginPeers* peers,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6058 uint32_t peerIndex)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6059 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6060 const char* target = NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6061
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6062 _OrthancPluginGetPeerProperty params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6063 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6064 params.target = &target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6065 params.peers = peers;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6066 params.peerIndex = peerIndex;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6067 params.userProperty = NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6068
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6069 if (context->InvokeService(context, _OrthancPluginService_GetPeerName, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6070 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6071 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6072 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6073 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6074 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6075 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6076 return target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6077 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6078 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6079
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6080
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6081 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6082 * @brief Get the base URL of an Orthanc peer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6083 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6084 * This function returns the base URL to the REST API of some Orthanc peer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6085 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6086 * This function is thread-safe: Several threads sharing the same
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6087 * OrthancPluginPeers object can simultaneously call this function.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6088 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6089 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6090 * @param peers The data structure describing the Orthanc peers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6091 * @param peerIndex The index of the peer of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6092 * This value must be lower than OrthancPluginGetPeersCount().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6093 * @result The URL, or NULL in the case of an error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6094 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6095 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6096 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetPeerUrl(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6097 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6098 const OrthancPluginPeers* peers,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6099 uint32_t peerIndex)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6100 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6101 const char* target = NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6102
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6103 _OrthancPluginGetPeerProperty params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6104 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6105 params.target = &target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6106 params.peers = peers;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6107 params.peerIndex = peerIndex;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6108 params.userProperty = NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6109
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6110 if (context->InvokeService(context, _OrthancPluginService_GetPeerUrl, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6111 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6112 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6113 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6114 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6115 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6116 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6117 return target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6118 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6119 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6120
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6121
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6122
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6123 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6124 * @brief Get some user-defined property of an Orthanc peer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6125 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6126 * This function returns some user-defined property of some Orthanc
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6127 * peer. An user-defined property is a property that is associated
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6128 * with the peer in the Orthanc configuration file, but that is not
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6129 * recognized by the Orthanc core.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6130 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6131 * This function is thread-safe: Several threads sharing the same
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6132 * OrthancPluginPeers object can simultaneously call this function.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6133 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6134 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6135 * @param peers The data structure describing the Orthanc peers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6136 * @param peerIndex The index of the peer of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6137 * This value must be lower than OrthancPluginGetPeersCount().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6138 * @param userProperty The user property of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6139 * @result The value of the user property, or NULL if it is not defined.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6140 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6141 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6142 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetPeerUserProperty(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6143 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6144 const OrthancPluginPeers* peers,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6145 uint32_t peerIndex,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6146 const char* userProperty)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6147 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6148 const char* target = NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6149
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6150 _OrthancPluginGetPeerProperty params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6151 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6152 params.target = &target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6153 params.peers = peers;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6154 params.peerIndex = peerIndex;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6155 params.userProperty = userProperty;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6156
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6157 if (context->InvokeService(context, _OrthancPluginService_GetPeerUserProperty, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6158 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6159 /* No such user property */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6160 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6161 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6162 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6163 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6164 return target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6165 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6166 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6167
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6168
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6169
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6170 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6171 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6172 OrthancPluginMemoryBuffer* answerBody;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6173 OrthancPluginMemoryBuffer* answerHeaders;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6174 uint16_t* httpStatus;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6175 const OrthancPluginPeers* peers;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6176 uint32_t peerIndex;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6177 OrthancPluginHttpMethod method;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6178 const char* uri;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6179 uint32_t additionalHeadersCount;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6180 const char* const* additionalHeadersKeys;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6181 const char* const* additionalHeadersValues;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6182 const char* body;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6183 uint32_t bodySize;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6184 uint32_t timeout;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6185 } _OrthancPluginCallPeerApi;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6186
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6187 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6188 * @brief Call the REST API of an Orthanc peer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6189 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6190 * Make a REST call to the given URI in the REST API of a remote
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6191 * Orthanc peer. The result to the query is stored into a newly
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6192 * allocated memory buffer. The HTTP request will be done according
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6193 * to the "OrthancPeers" configuration option of Orthanc.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6194 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6195 * This function is thread-safe: Several threads sharing the same
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6196 * OrthancPluginPeers object can simultaneously call this function.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6197 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6198 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6199 * @param answerBody The target memory buffer (out argument).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6200 * It must be freed with OrthancPluginFreeMemoryBuffer().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6201 * @param answerHeaders The target memory buffer for the HTTP headers in the answers (out argument).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6202 * The answer headers are formatted as a JSON object (associative array).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6203 * The buffer must be freed with OrthancPluginFreeMemoryBuffer().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6204 * This argument can be set to NULL if the plugin has no interest in the HTTP headers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6205 * @param httpStatus The HTTP status after the execution of the request (out argument).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6206 * @param peers The data structure describing the Orthanc peers.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6207 * @param peerIndex The index of the peer of interest.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6208 * This value must be lower than OrthancPluginGetPeersCount().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6209 * @param method HTTP method to be used.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6210 * @param uri The URI of interest in the REST API.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6211 * @param additionalHeadersCount The number of HTTP headers to be added to the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6212 * HTTP headers provided in the global configuration of Orthanc.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6213 * @param additionalHeadersKeys Array containing the keys of the HTTP headers (can be <tt>NULL</tt> if no header).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6214 * @param additionalHeadersValues Array containing the values of the HTTP headers (can be <tt>NULL</tt> if no header).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6215 * @param body The HTTP body for a POST or PUT request.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6216 * @param bodySize The size of the body.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6217 * @param timeout Timeout in seconds (0 for default timeout).
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6218 * @return 0 if success, or the error code if failure.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6219 * @see OrthancPluginHttpClient()
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6220 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6221 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6222 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCallPeerApi(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6223 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6224 OrthancPluginMemoryBuffer* answerBody,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6225 OrthancPluginMemoryBuffer* answerHeaders,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6226 uint16_t* httpStatus,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6227 const OrthancPluginPeers* peers,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6228 uint32_t peerIndex,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6229 OrthancPluginHttpMethod method,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6230 const char* uri,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6231 uint32_t additionalHeadersCount,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6232 const char* const* additionalHeadersKeys,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6233 const char* const* additionalHeadersValues,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6234 const char* body,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6235 uint32_t bodySize,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6236 uint32_t timeout)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6237 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6238 _OrthancPluginCallPeerApi params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6239 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6240
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6241 params.answerBody = answerBody;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6242 params.answerHeaders = answerHeaders;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6243 params.httpStatus = httpStatus;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6244 params.peers = peers;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6245 params.peerIndex = peerIndex;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6246 params.method = method;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6247 params.uri = uri;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6248 params.additionalHeadersCount = additionalHeadersCount;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6249 params.additionalHeadersKeys = additionalHeadersKeys;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6250 params.additionalHeadersValues = additionalHeadersValues;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6251 params.body = body;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6252 params.bodySize = bodySize;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6253 params.timeout = timeout;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6254
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6255 return context->InvokeService(context, _OrthancPluginService_CallPeerApi, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6256 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6257
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6258
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6259
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6260
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6261
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6262 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6263 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6264 OrthancPluginJob** target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6265 void *job;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6266 OrthancPluginJobFinalize finalize;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6267 const char *type;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6268 OrthancPluginJobGetProgress getProgress;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6269 OrthancPluginJobGetContent getContent;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6270 OrthancPluginJobGetSerialized getSerialized;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6271 OrthancPluginJobStep step;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6272 OrthancPluginJobStop stop;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6273 OrthancPluginJobReset reset;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6274 } _OrthancPluginCreateJob;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6275
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6276 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6277 * @brief Create a custom job.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6278 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6279 * This function creates a custom job to be run by the jobs engine
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6280 * of Orthanc.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6281 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6282 * Orthanc starts one dedicated thread per custom job that is
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6283 * running. It is guaranteed that all the callbacks will only be
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6284 * called from this single dedicated thread, in mutual exclusion: As
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6285 * a consequence, it is *not* mandatory to protect the various
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6286 * callbacks by mutexes.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6287 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6288 * The custom job can nonetheless launch its own processing threads
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6289 * on the first call to the "step()" callback, and stop them once
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6290 * the "stop()" callback is called.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6291 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6292 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6293 * @param job The job to be executed.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6294 * @param finalize The finalization callback.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6295 * @param type The type of the job, provided to the job unserializer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6296 * See OrthancPluginRegisterJobsUnserializer().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6297 * @param getProgress The progress callback.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6298 * @param getContent The content callback.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6299 * @param getSerialized The serialization callback.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6300 * @param step The callback to execute the individual steps of the job.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6301 * @param stop The callback that is invoked once the job leaves the "running" state.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6302 * @param reset The callback that is invoked if a stopped job is started again.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6303 * @return The newly allocated job. It must be freed with OrthancPluginFreeJob(),
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6304 * as long as it is not submitted with OrthancPluginSubmitJob().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6305 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6306 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6307 ORTHANC_PLUGIN_INLINE OrthancPluginJob *OrthancPluginCreateJob(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6308 OrthancPluginContext *context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6309 void *job,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6310 OrthancPluginJobFinalize finalize,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6311 const char *type,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6312 OrthancPluginJobGetProgress getProgress,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6313 OrthancPluginJobGetContent getContent,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6314 OrthancPluginJobGetSerialized getSerialized,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6315 OrthancPluginJobStep step,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6316 OrthancPluginJobStop stop,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6317 OrthancPluginJobReset reset)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6318 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6319 OrthancPluginJob* target = NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6320
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6321 _OrthancPluginCreateJob params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6322 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6323
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6324 params.target = &target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6325 params.job = job;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6326 params.finalize = finalize;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6327 params.type = type;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6328 params.getProgress = getProgress;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6329 params.getContent = getContent;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6330 params.getSerialized = getSerialized;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6331 params.step = step;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6332 params.stop = stop;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6333 params.reset = reset;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6334
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6335 if (context->InvokeService(context, _OrthancPluginService_CreateJob, &params) != OrthancPluginErrorCode_Success ||
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6336 target == NULL)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6337 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6338 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6339 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6340 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6341 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6342 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6343 return target;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6344 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6345 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6346
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6347
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6348 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6349 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6350 OrthancPluginJob* job;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6351 } _OrthancPluginFreeJob;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6352
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6353 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6354 * @brief Free a custom job.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6355 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6356 * This function frees an image that was created with OrthancPluginCreateJob().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6357 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6358 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6359 * @param job The job.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6360 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6361 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6362 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeJob(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6363 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6364 OrthancPluginJob* job)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6365 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6366 _OrthancPluginFreeJob params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6367 params.job = job;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6368
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6369 context->InvokeService(context, _OrthancPluginService_FreeJob, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6370 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6371
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6372
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6373
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6374 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6375 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6376 char** resultId;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6377 OrthancPluginJob *job;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6378 int priority;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6379 } _OrthancPluginSubmitJob;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6380
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6381 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6382 * @brief Submit a new job to the jobs engine of Orthanc.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6383 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6384 * This function adds the given job to the pending jobs of
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6385 * Orthanc. Orthanc will take take of freeing it by invoking the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6386 * finalization callback provided to OrthancPluginCreateJob().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6387 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6388 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6389 * @param job The job, as received by OrthancPluginCreateJob().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6390 * @param priority The priority of the job.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6391 * @return ID of the newly-submitted job. This string must be freed by OrthancPluginFreeString().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6392 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6393 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6394 ORTHANC_PLUGIN_INLINE char *OrthancPluginSubmitJob(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6395 OrthancPluginContext *context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6396 OrthancPluginJob *job,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6397 int priority)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6398 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6399 char* resultId = NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6400
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6401 _OrthancPluginSubmitJob params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6402 memset(&params, 0, sizeof(params));
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6403
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6404 params.resultId = &resultId;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6405 params.job = job;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6406 params.priority = priority;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6407
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6408 if (context->InvokeService(context, _OrthancPluginService_SubmitJob, &params) != OrthancPluginErrorCode_Success ||
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6409 resultId == NULL)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6410 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6411 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6412 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6413 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6414 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6415 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6416 return resultId;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6417 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6418 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6419
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6420
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6421
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6422 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6423 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6424 OrthancPluginJobsUnserializer unserializer;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6425 } _OrthancPluginJobsUnserializer;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6426
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6427 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6428 * @brief Register an unserializer for custom jobs.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6429 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6430 * This function registers an unserializer that decodes custom jobs
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6431 * from a JSON string. This callback is invoked when the jobs engine
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6432 * of Orthanc is started (on Orthanc initialization), for each job
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6433 * that is stored in the Orthanc database.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6434 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6435 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6436 * @param unserializer The job unserializer.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6437 * @ingroup Callbacks
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6438 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6439 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterJobsUnserializer(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6440 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6441 OrthancPluginJobsUnserializer unserializer)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6442 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6443 _OrthancPluginJobsUnserializer params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6444 params.unserializer = unserializer;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6445
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6446 context->InvokeService(context, _OrthancPluginService_RegisterJobsUnserializer, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6447 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6448
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6449
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6450
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6451 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6452 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6453 OrthancPluginRestOutput* output;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6454 const char* details;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6455 uint8_t log;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6456 } _OrthancPluginSetHttpErrorDetails;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6457
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6458 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6459 * @brief Provide a detailed description for an HTTP error.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6460 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6461 * This function sets the detailed description associated with an
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6462 * HTTP error. This description will be displayed in the "Details"
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6463 * field of the JSON body of the HTTP answer. It is only taken into
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6464 * consideration if the REST callback returns an error code that is
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6465 * different from "OrthancPluginErrorCode_Success", and if the
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6466 * "HttpDescribeErrors" configuration option of Orthanc is set to
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6467 * "true".
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6468 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6469 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6470 * @param output The HTTP connection to the client application.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6471 * @param details The details of the error message.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6472 * @param log Whether to also write the detailed error to the Orthanc logs.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6473 * @ingroup REST
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6474 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6475 ORTHANC_PLUGIN_INLINE void OrthancPluginSetHttpErrorDetails(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6476 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6477 OrthancPluginRestOutput* output,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6478 const char* details,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6479 uint8_t log)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6480 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6481 _OrthancPluginSetHttpErrorDetails params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6482 params.output = output;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6483 params.details = details;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6484 params.log = log;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6485 context->InvokeService(context, _OrthancPluginService_SetHttpErrorDetails, &params);
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6486 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6487
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6488
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6489
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6490 typedef struct
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6491 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6492 const char** result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6493 const char* argument;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6494 } _OrthancPluginRetrieveStaticString;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6495
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6496 /**
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6497 * @brief Detect the MIME type of a file.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6498 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6499 * This function returns the MIME type of a file by inspecting its extension.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6500 *
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6501 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6502 * @param path Path to the file.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6503 * @return The MIME type. This is a statically-allocated
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6504 * string, do not free it.
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6505 * @ingroup Toolbox
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6506 **/
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6507 ORTHANC_PLUGIN_INLINE const char* OrthancPluginAutodetectMimeType(
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6508 OrthancPluginContext* context,
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6509 const char* path)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6510 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6511 const char* result = NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6512
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6513 _OrthancPluginRetrieveStaticString params;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6514 params.result = &result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6515 params.argument = path;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6516
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6517 if (context->InvokeService(context, _OrthancPluginService_AutodetectMimeType, &params) != OrthancPluginErrorCode_Success)
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6518 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6519 /* Error */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6520 return NULL;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6521 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6522 else
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6523 {
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6524 return result;
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6525 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6526 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6527
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6528
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6529 #ifdef __cplusplus
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6530 }
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6531 #endif
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6532
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6533
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6534 /** @} */
badc89b06477 upgrading orthanc sdk from 1.4.0 to 1.5.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6535